I want to trigger change event of checkbox two on checking on checkbox one. So far after second one is checked when first one is checked. But I couldn't get second one to fire its change event Here's my code This is my template code
<input [ngModel]="firstOne" (ngModelChange)="someEvent($event)" type="checkbox">
<input [ngModel]="secondOne" (ngModelChange)="secondEvent($event)" type="checkbox">
Controller code
this.firstOne:boolean=false;
this.secondOne:boolean=false;
constructor(){}
someEvent(event){
this.secondOne = true;
}
secondEvent(event){
alert("second is triggered")
}
Thanks for any suggestion. I have tree of check box with their itemId and parentId. On initialization the api i am using provides last child's itemId. So my idea is to check the last child check box using the itemId and then trigger events which will check its parents using its parentId causing a chain check.