0
I work with Angularjs and Angular2+ almost two years ago and recently, in Angular2+, I came across a different situation that made me wonder if it was a coincidence or because of the version of Angular I’m using. But someone knows the reason or has already gone through this I report below?
Example:
ps: Attend ngModelChange and ngModel event
Declare an INPUT tag in the following order:
<input [(ngModel)]="valor.numero" (ngModelChange)="validarValor()"/>
Different from reversing the order of attributes:
<input (ngModelChange)="validarValor()" [(ngModel)]="valor.numero"/>
In the first situation, I can use the value.numero in the validationValue method normally, which I cannot do using the second situation because the value is not set yet.
Really the precedence of TAG attributes/events/parameters matter?
Stay there tbm the tip, in case someone is going through the problem I went through, because at first I was not able to manipulate the value, because it had not yet been set.
Thanks in advance!