I konw what is two way data binding, but there is also ([ngModel]), It is reverse version of [(ngModel)]? then what is ([ngModel])? how it works?
Asked
Active
Viewed 420 times
-4
-
1I don't think there is anything such as `([ngModel])`. We have `[(ngModel)]` for two-way binding but not the first one. If you have came across one and important if that is not throwing errors, can you share link to that, I would be curious to study on that furthur! – Aakash Goplani Mar 12 '22 at 09:06
-
Yes I have came across to that scenario. It is used as ([ngModel]) – Rohit Hushare Mar 17 '22 at 05:46
1 Answers
0
([])
called a BANANA IN A BOX.
We can say it's a sugre syntax for two parts:
[ngModel] : to keep the view updated when the model is changing.
(ngModelChange) : to keep model updated when the view is changing.
you can create your own two way binding : Example

Souhail Chougrani
- 595
- 4
- 17
-
[] = box () = banana. [()] = banana in a box Author asked for ([]) -> Please notice the difference, confusing yes, but a major difference!! – Aakash Goplani Mar 17 '22 at 11:28