Angular 1.3 +
In 1.3, Angular supports this using the following syntax.
<div>{{::message}}</div>
As mentioned in this answer .
Angular 1.2 and below
It is simple and does not require a plugin. Check this.
This little directive will easily accomplish what you are trying to achieve.
app.directive('bindOnce', function() { return { scope: true, link: function( $scope ) { setTimeout(function() { $scope.$destroy(); }, 0); } } });
You can knit once, like this
<div bind-once>I bind once - {{message}}</div>
You can be attached as usual
<div ng-bind="message" bind-once></div>
Demo: http://jsfiddle.net/fffnb/
Some of you may use Angular batarang, and as mentioned in the comments, if you use this directive, the element still displays as a binding, when it is not, I am sure this has something to do with classes that are attached to element, try this, it should work (not verified). Let me know in the comments if this works for you.
app.directive('bindOnce', function() { return { scope: true, link: function( $scope, $element ) { setTimeout(function() { $scope.$destroy(); $element.removeClass('ng-binding ng-scope'); }, 0); } } });
@ x0b : If you have an OCD and want to remove the empty class attribute, do this
!$element.attr('class') && $element.removeAttr('class')