Is it possible to style an element using ngModelChange? I attempted the following method, but it was unsuccessful
<input class="input" [(ngModel)]="counter" (ngModelChange)="$event > 2 ? [style.border-color]='#ff4d4d' : [style.border-color]='#dbdbdb'" type="number">
I am aware that I can achieve something similar with
<input class="input" [(ngModel)]="counter" (ngModelChange)="$event > 2 ? error=true : error=false" type="number" [style.border-color]="error ? '#ff4d4d' : '#dbdbdb'">
However, I would like to see if it is possible to eliminate the 'error' attribute and directly assign the style to the input based on the condition