Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

How does data binding work in the AngularJS framework?

I haven't found technical details on their site. It's more or less clear how it works when data is propagated from view to model. But how does AngularJS track changes of model properties without setters and getters?

I found that there are JavaScript watchers that may do this work. But they are not supported in Internet Explorer 6 and Internet Explorer 7. So how does AngularJS know that I changed, for example, the following and reflected this change on a view?

myobject.myproperty="new value";

1 Answer

0 votes
by (106k points)

In AngularJS the data binding work as follows:-

AngularJS always remembers the value and compares it to a previous value. If it sees any change in value, then it fires the change event.

For data binding between a non-AngularJS world into an AngularJS world $apply() method is used which is what you call when you are transitioning, calls $digest().

Related questions

0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...