Angular 2 two way data binding not working
Solution 1:
It's because check_send
needs to be testChange
as it is written in the documentation, Angular de-sugars that code with a xxxChange
syntax.
<child-component [test]="check" (testChange)="check=$event">This child updates all</child-component>
@Output() testChange = new EventEmitter<number>();
this.testChange.emit(this.test);
Fixed stackblitz: https://stackblitz.com/edit/angular-ivy-165fvb?file=src%2Fapp%2Fapp.component.ts