In short, I want to ask about the differences between:
A: {{ variable | filter }}
and
B: {{ 'static string' | filter }}
These are my questions:
- Are both of them called interpolations or only
A
? A
uses$interpolate
, while theB
uses$parse
- is that true? (basing on another SO question)- What is the performance difference? When I use
A
, each time thevariable
value changes, the template is updated (the variable is listened for changes). If there are great lots of interpolations such asA
, there might be performance problems due to lots of listening on models. Is that different forB
? Especially, I'm considering using http://angular-translate.github.io/, which usestranslate
filter. There is a global variable somewhere, holding actual language used in the interface and when it is changed, allB
interpolations usingtranslate
filters will be updated. But how does it work underneath, what is listening on what? Is there just one listener on the language variable value (held inside angular config) which enables registering multiple i18n-labels to be translated when the language changes? Or are there multiple listeners? If I have 500{{ 'static string' | translate }}
interpolations, will it slow down my application due to listeners?
If I'm mistaken anywhere, please correct me.