Created
August 14, 2018 13:46
-
-
Save alaawahbah/fcd19fdf8d051cd9c656cae8839265d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--<li *ngFor="let responsible of ResponsibleGroup; let i = index" formArrayName="ResponsibleGroup">--> | |
<li *ngFor="let responsible of employeeSettingsForm.controls.ResponsibleGroup.controls; let i = index"> | |
<label class="form-check-label"> | |
<input class="form-check-input" value="{{responsible.ID}}" type="checkbox" (change)="Changed($event)"> | |
<span class="btn btn-light btn-round btn-sm">{{isArabic?responsible.NameAr:responsible.NameEn}}<i class="fas fa-plus"></i></span> | |
</label> | |
</li> | |
this.allGroups.subscribe(t => { | |
//this.employeeSettingsForm.controls['ResponsibleGroup'].push( t); | |
let controlArray = <FormArray>this.employeeSettingsForm.controls['ResponsibleGroup'] | |
t.forEach(app => { | |
//const fb = this.buildGroup(); | |
//fb.patchValue(app); | |
//controlArray.push(fb); | |
controlArray.push(new FormControl(app)); | |
}); | |
}) | |
this.employeeSettingsForm = this.formBuilder.group({ | |
Employee: [null, [Validators.required]], | |
EmployeeRole: [null], | |
ResponsibleGroup: this.formBuilder.array([]), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment