I've been working with AngularJs and Angular2 + for almost two years and recently, in Angular2 +, I came across a different situation that made me wonder if it was a coincidence or because of the Angular version I'm using. But does anyone know the reason or has it gone through what I report below?
Example:
ps: Attend to the event ngModelChange and ngModel
Declare an INPUT tag in the following order:
<input [(ngModel)]="valor.numero" (ngModelChange)="validarValor()"/>
It's different than inverting the order of attributes:
<input (ngModelChange)="validarValor()" [(ngModel)]="valor.numero"/>
In the first situation, I can use the value.number in the validateValue method normally, which I can not do using the second situation because the value is not yet set.
Does the TAG attribute / event / parameter precedence really matter?
I'm not sure what to do,
Thank you in advance!