Coming soon!

One-time binding in AngularJS

I've been a full-time Angular developer for about two years now, and I just now came across the correct way to implement pure one-time binding. You can use this in views, but more importantly, use it in lists with ng-repeat for significant performance improvements! Take a look at the following

  • angular
  • performance
  • javascript
  • html

By Tim Sommer · 11/23/2016 7:03:00 AM

I've been a full-time Angular developer for about two years now, and I just now came across the correct way to implement pure one-time binding.

You can use this in views, but more importantly, use it in lists with ng-repeat for significant performance improvements!

Take a look at the following expressions:

One time binding: {{::name}}

Normal binding: {{name}}

If the name changes, the second div will be updated. The first one will not, because you use the one-time binding '::' expression.

The main purpose of one-time binding expression is to provide a way to create a binding that gets deregistered and frees up resources once the binding is stabilized. Reducing the number of expressions being watched makes the digest loop faster and allows more information to be displayed at the same time.
-Angular documentation

So, one-way binding is faster! Use it in lists that get loaded once and you will immediately see improvements in performance and responsiveness!

Source: https://docs.angularjs.org/guide/expression#one-time-binding

Happy coding !


  • angular
  • performance
  • javascript
  • html

By Tim Sommer · 11/23/2016 7:03:00 AM

Share this blogpost

Looking for talent?

Fill in the form below and we’ll get back to you as soon as possible.

Oops. You seem to have written your full name in invisible ink. Please enter it so we can read it. Oops. You seem to have written your company in invisible ink. Please enter it so we can read it. It seems your e-mail doesn’t exist. Please enter a real one so we can contact you. Oops. You seem to have written your telephone in invisible ink. Please enter it so we can read it.