O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Two-way binding

Angular has removed a core feature from its framework, which was one main reason for the birth of AngularJS, that is, two-way binding. So, two way binding is not available by default. Now, let's see how to implement a two-way binding in Angular.

Angular combined property and event binding for us to implement two-way binding, as shown in the following line of code:

<input [(ngModel)]="authorName">

The code snippet shows that ngModel is wrapped with parentheses and then with square brackets. The parentheses indicate that the component property is tied up with the ngChange event, and the square brackets indicate that the component property is assigned to a value property of the input element. So, when the value of the input ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required