ng-change with dynamic object

0

Good morning, I'm using angle 2 and I'm having trouble using the 'ng-change' property after I dynamically generate the object below:

<input type=text class="insert" id="input' + data.id + '"  ng-model="input" ng-change="myFunction()"  maxlength="48" autofocus/>

Angle properties just does not work, how can I solve this problem?

    
asked by anonymous 18.10.2018 / 14:55

1 answer

0

Try this,

change the binding to [ngModel] and use the (ngModelChange) event

<input type=text class="insert" id="input' + data.id + '"  [ngModel]="input" (ngModelChange)="myFunction($event)" maxlength="48" autofocus/>
    
18.10.2018 / 15:24