October 20, 2020

Understanding Two-Way Data Binding in AngularJs

Hands down two-way data binding is one of the biggest strengths of AngularJs. Because now, it seems impossible to work without it. Because this was so NEEDED! So, let us get straight into it and understand it to the core.

 

ONE-WAY DATA BINDING( Before AngularJS)

Before Two-Way Binding, View and Model were two separate entities and there was no relation between them as such that the changes could be in sync, hence it was the responsibility of the developer to capture the changes in the view and reflect them on a model, and similarly changes done at model been reflected in the view. The diagram below represents the earlier traditional approach of data binding.

                                  

 

TWO-WAY DATA BINDING( In AngularJS)

Now. with DATA -BINDING in AngularJS, View reflects the changes in model bound by ng-model and the model reflects the changes in the view which are given in the {{}}brackets. Here, there is no role of controller and need for a developer to sync them, hence it has made coding excessively easier. Here, the view knows to bind through the model present in the ng-model which is “user” here. And view would reflect the changes and directly bind the model’s value through {{}}

 


 

Hope, it would have made you clear with the data binding concept. If you still have any doubt, leave it in the comment section below. Our team would revert within 24 hours.

Do Follow our Facebook page https://www.facebook.com/lovebeingengineer/.

If you are looking for a detailed blog on hiring AngularJs developers, then do check out https://www.toptal.com/angular-js#hiring-guide.You will love it!

Similar Blogs:

https://www.toptal.com/angular-js#hiring-guide

 

 

 

 

 

 

 

 

 

 

admin

Engineer Diaries started with the need to bridge the huge gap in what we are taught vs what the industry demands. We are based in Delhi, India but our blog is for everyone, in and outside tech industry❤ Feel free to reach out to us at engineerdiaries@gmail.com for any business/personal query.

View all posts by admin →

Leave a Reply