Question:

How does interpolation, e.g. “{{ someModel }}”, actually work?

Answer:

It relies on $interpolation, a service which is called by the compiler. It evaluates text and markup which may contain AngularJS expressions. For every interpolated expression, a “watch()” is set. $interpolation returns a function, which has a single argument, “context”. By calling that function and providing a scope as context, the expressions are “$parse()”d against that scope.


Keywords:

© 2017 QuizBucket.org