Nativescript Switch prevent change event firing on initial binding
问题 Hi my template is something like the below <ListView [items]="modules"> <template let-item="item" > <StackLayout orientation="vertical"> <Switch (checkedChange)="onSwitchModule(item.id,$event)" [checked]="item.active"></Switch> </StackLayout> </template> </ListView> My controller is ngOnInit() { this._moduleService.getUserModules() .subscribe( response=>{ this.modules = response.data; } ) } onSwitchModule(itemId) { console.log(itemID); //Gets called on initial true binding on switch checked }