Read more

AngularJS 1 Performance: One-time bindings in expressions

Thomas Klemm
October 30, 2014Software engineer

In addition to the {{ myValue }} two-way binding syntax, since Angular 1.3 there's a one-time binding syntax, prefixing the value or expression with ::, e.g. {{ ::myValue }}, {{ ::myValue >= 42 }} and {{ ::myExpression(value) | someFilter }}.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

One-time bound expressions get dropped from the list of watchers as soon as they can be resolved. Performance-wise the impact for this small change is huge, since Angular apparently slowes down with too many watchers registered (Source) Show archive.org snapshot . Wherever values don't change after they've been rendered, this syntax can be safely used.

Posted by Thomas Klemm to makandra dev (2014-10-30 16:50)