You can use the specific expression
::
like so:
<div>{{::item}}</div>
or
<ul>
<li ng-repeat="item in ::items">{{item}}</li>
</ul>
to bind expression once since angular 1.3: bind once since 1.3
Also, there are specific libraries like:
angular-once or bindonce
EDIT:
I found the following function in the source of angularjs 1.3:
function oneTimeWatch(scope, listener, objectEquality, deregisterNotifier, parsedExpression) {
var unwatch, lastValue;
return unwatch = scope.$watch(function oneTimeWatch(scope) {
return parsedExpression(scope);
}, function oneTimeListener(value, old, scope) {
lastValue = value;
if (isFunction(listener)) {
listener.apply(this, arguments);
}
if (isDefined(value)) {
scope.$$postDigest(function() {
if (isDefined(lastValue)) {
unwatch();
}
});
}
}, objectEquality, deregisterNotifier);
}
It is located at src/ng/parse.js, starting at line 1031:oneTimeWatch
However, in 1.4, the function is called
oneTimeWatchDelegate
bindoncedoes the same, unregister watch when value is resolved