I am currently exploring how to develop my own "one-time binding" functionality for AngularJS version 1.2 and earlier. I came across this response which explains the process of creating a custom bindOnce directive. Upon using the provided directive:
app.directive('bindOnce', function() {
return {
scope: true,
link: function( $scope ) {
setTimeout(function() {
$scope.$destroy();
}, 0);
}
}
});
The data is bound only once. However, I noticed that even though the data is bound once, the $$watchers are still active. You can verify this by checking the watcher count in the following JSBin example - running the commented watcher count code in the console displays that the watchers are still present.
UPDATE: Interestingly, when utilizing the same directive with Angular 1.3, the watcher count actually becomes 0!!!