import {
    FormControl,
    FormGroup
} from "@angular/forms";
import {
    MagicServices
} from "@magic-xpa/angular";
export enum MgControlName {
    TodoListEdit = "TodoListEdit",
        V_Title = "V_Title",
        V_Todo = "V_Todo",
        BtnUpdate = "BtnUpdate",
}
export enum MgCustomProperties {}
export class MgFormControlsAccessor {
    constructor(private fg: FormGroup, private magicServices: MagicServices) {}

    get V_Title(): FormControl {
        return this.fg.controls[MgControlName.V_Title] as FormControl;
    }

    get V_Todo(): FormControl {
        return this.fg.controls[MgControlName.V_Todo] as FormControl;
    }

    getTableChildFormControl(name: MgControlName): FormControl {
        return this.magicServices.mgAccessorService.getFormGroupByRow(this.magicServices.tableService.getSelectedRow()).controls[name] as FormControl;
    }
}