controlvalueaccessor

Angular Two-Way Data Binding and Watching for Changes in Parent Component

旧街凉风 提交于 2019-12-21 17:22:33
问题 It seems there is no way to watch changes in the parent component when using two-way data binding. I have a custom input component for collecting a tag list. Two-way data binding is setup and working between this component and its parent. // the parent component is just a form // here is how I'm adding the child component <input-tags formControlName="skillField" [(tags)]='skillTags' (ngModelChange)="skillTagUpdate($event)"></input-tags> In the parent component how do you watch the bound

Multiple form controls in child component with control value accessor using Angular 5

不问归期 提交于 2019-12-13 03:36:18
问题 I want to implement a functionality with control value accessor in Angular 5. It's like to access multiple form control in child custom component from a parent. Please let me know if I can achieve this in another way. Template driven form compulsory. If there is any other any to generic create a custom control with two-way data binding, please let me know. It would great if answers are in Plunker or StackBlitz. Here is mine: https://stackblitz.com/edit/angular-qzioet Parent component :-

nested custom FormArray component doesn't bind with child form with FormArrayName

﹥>﹥吖頭↗ 提交于 2019-11-30 21:15:27
问题 I tried to have 2 nested forms using CVA. the problem is the second from isn't initialized with data when I bind it to a formControl. Stackblitz I have MAIN-FORM : this.requestForm = this.fb.group({ garageId: 0, routes: new FormArray([ new FormGroup({ addressPointId: new FormControl, municipalityId: new FormControl, regionId: new FormControl, rvId: new FormControl, sequenceNumber: new FormControl, settlementId: new FormControl, regionName: new FormControl, municipalityName: new FormControl,