The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

New in Angular 1.3 - Bind Once

New in Angular 1.3 - Bind Once

5:33
AngularJS's two-way binding is one of the "killer features" of the framework. The problem is that too many bindings can cause performance issues! Many times, all you need to do is bind a single time to get the data to display, and don't need dynamic two-way binding. In Angular 1.3, they've added new syntax to enable one-time data bindings.
Watch this lesson now
Avatar
egghead.io

AngularJS's two-way binding is one of the "killer features" of the framework. The problem is that too many bindings can cause performance issues! Many times, all you need to do is bind a single time to get the data to display, and don't need dynamic two-way binding. In Angular 1.3, they've added new syntax to enable one-time data bindings.

Avatar
Bilal

$scope.$watch('::people') doesn't work as people is on the view model vm not the scope.

Previously i've had to do the following to get watchers to work on the vm
$scope.$watch(function () {
return vm.people;
}, function (val) {}))

But as the vm.people is not a string in this case, i'm not sure how to use the '::' prefix

Thanks for your help!

In reply to egghead.io
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?