Angular 1.5 One-Time Binding Notes

Handsontable JavaScript Spreadsheet Most popular component for web apps

We can use Angular’s (1.3+) in-built one-time bindings to gain a performance boost on data which is set once and never changes. The way it works is by removing the watchers ($watch() bindings) on scope bound expressions so when the values are set once they revoke their binding. This reduces the number of watchers registered on the $digest cycle and consequently the number of re-renders on the DOM.

Angular Official Docs:

“One-time expressions will stop recalculating once they are stable, which happens after the first digest…”
This is how you do one-time bindings.



Because it blows up.

Additional thoughts around one-time bindings:

  • Only use one-time binding on values which DO NOT change once the page has loaded.
Sam Deering

Sam Deering

Sam is a web developer, online entrepreneur and investor. In his spare time he enjoys coding, playing chess and sharing what he learns with others.

Leave a Reply

Your email address will not be published. Required fields are marked *