nativescript-angular
nativescript-angular copied to clipboard
core.js:4117 ERROR TypeError: Cannot read property 'push' of null
onCheckChange(event) { const formArrayItem: FormArray = this.createSubscrition.get('weekDays') as FormArray; console.log(formArrayItem) if(event.target.checked){ console.log(event.target.value); formArrayItem.push(new FormControl(event.target.value)) } else{ let i: number = 0; formArrayItem.controls.forEach((ctrl: FormControl) => { if(ctrl.value == event.target.value) { formArrayItem.removeAt(i); return; } i++; }); }
}