Two-way binding gives your app a way to share data between a component class and its template.
The binding goes both ways. If the user changes the value inside the input field,
the AngularJS property will also change its value.
When data in the model changes, the view reflects the change, and when data in the view changes,
the model is updated as well.
Basics of two-way binding:
Two-way binding does two things:
1.Sets a specific element property.
2.Listens for an element change event.
Angular offers a special two-way data binding syntax for this purpose,[()].
The [()] syntax combines the brackets of property binding,, with the parentheses of event binding,().
The ng-init directive can be used to initialize variables in AngularJS application.
When data in the model changes, the view reflects the change,
and when data in the view changes, the model is updated as well.
Lets see an example: