URL: http://plnkr.co/edit/YHrf1fpJmuusqOoLE59A?p=info

You might have heard that AngularJS 1.3 has "one-time bindings" which is that you can print the value of a scope variable with {{ ::somevar }} and that this is really good for performance because it means that once rendered it doesn't add to the list of things that the angular app needs to keep worrying about. I.e. it's one less thing to watch.

But what's a good use case of this? This is a good example.

Because ng-if="true" will cause the DOM element to be re-created it will go back to the scope variable and re-evaluate it.

Comments

Srinivas Kasiriveni

nice blog

Your email will never ever be published.

Previous:
vipsthumbnail December 8, 2014 Linux
Next:
Fastest way to take screencaps out of videos December 19, 2014 Linux, Web development, Mozilla
Related by category:
How to SSG a Vite SPA April 26, 2025 JavaScript
Switching from Next.js to Vite + wouter July 28, 2023 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
get in JavaScript is the same as property in Python February 13, 2025 JavaScript