In my template I have 

<div>
  <label><input type="checkbox" [(ngModel)]="state" [ngFormControl]="stateCtrl" 
(click)="call()"/> {{state}}</label>
</div>
<div *ngFor="let item of items">
  <my-item></my-item>
</div>


In my class I have


@ViewChildren(RandomClass)
children:RandomClass[];


Now inside the constructor I have


this.stateCtrl = new Control();
this.stateCtrl.valueChanges.subscribe(
    data => {
        this.children.forEach(child => {
            child.state = data;
        });
    });


This gives me access to control all the items through the stateCtrl alone. But 
I want to access each child of 'children' individually. Is there a way I can 
use a subscribe on the 'children' to get their individual status change ?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to