Can any one help me out to understand what exactly two way data binding in AngularJS means with a help of simple code.
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
|
One way data binding - The model values are automatically assigned to the HTML placeholder elements specified through the data binding notation, but the HTML elements don't change the values in the model(one way). Example : Controller :
HTML :
Two Way Data Binding - The model values are automatically assigned to the HTML placeholder elements specified through the data binding notation, where HTML elements can change the value in the model(two way). Example : Controller :
HTML
In above example we can change firstName model value with the help of HTML Input element. Working example : http://plnkr.co/edit/GxqBiOoNFuECn55R4uJZ?p=preview |
|||||||||||||||||
|
Retrieved from the AngularJS homepage (2015.06.02):
This is possibly the simplest example of two-way data binding in Angular. Although the data binding in the example can be seen as one-way, because you can't modify the |
|||
|