Search code examples
javascriptangulardata-bindingangular-ngmodel

Is Angular4 really 2-Way data-Binding?


What I have learned of Angular2/4/5/6 is that due to [(ngModel)] the 2-way data binding is possible in it -- Just like it happend in Angular1 via $scope.

Now, I came across this website which clearly states that 2-Way data binding is not possible in Angular4. I am highly confused. Can someone really clarify that -- whether 2-Way data binding is possible or Not in Angular 2/4/5/6?

enter image description here

Link: https://dzone.com/articles/understanding-output-and-eventemitter-in-angular


Solution

  • enter image description here

    whether 2-Way data binding is possible or Not in Angular 2/4/5/6?

    Nope, it is not [(ngModel)] is not two-way data binding. It’s just a syntactic sugar for a simultaneous event binding and property binding.

    To Explore more on this

    1. Do you really know what unidirectional data flow means in Angular

    2. Change Detection Reinvented Victor Savkin
    3. TWO-WAY DATA BINDING IN ANGULAR