I currently understand that [(ngModel)]="expression"
is two-way binding from component to view and vice versa. I also understand that [ngModel]="expression"
is one-way binding (I believe from component to view?). Then there's the possibility of (ngModel)="expression"
. I am mostly confused as to the differences between [ngModel]
vs (ngModel)
. Could someone please explain?
EDIT: After playing around with, and reviewing the document snippet given by @Rohan Fating I realized that something like (ngModel)
should take a statement, rather than an expression. That being said, would there ever be an appropriate time to use something like (ngModel)
or would that even work in any circumstance?