Reputation: 139
I can't help but wonder how does Angular reads interpolation and expression inside interpolation.
<div>{{ name }}</div>
How does it resolve name variable to html in the background?
Upvotes: 1
Views: 61
Reputation: 86740
During the compilation process the compiler uses the $interpolate service to see if text nodes and element attributes contain interpolation markup with embedded expressions.
If that is the case, the compiler adds an interpolateDirective to the node and registers watches on the computed interpolation function, which will update the corresponding text nodes or attribute values as part of the normal digest cycle.
Upvotes: 4