AngularJS 1.3

One-time data binding


Two Way Data Binding

It's what makes using Angular so easy!
<div>
  Hello {{yourName}}. You are {{yourAge}}!
</div>
<div>
  Your Name: <input ng-model="yourName">
  Your Age: <input ng-model="yourAge">
</div>



AngularJS Performance

$digest   and   $$watchers


Too long...

 

It'll surprise you...


Enter One Time Binding


Example Usages

$scope.$watch('::doACalculation()', watchListener);

<div ng-repeat="person in ::people"> <!-- people is boundonce... -->
  {{::person.name}}
  {{person.age}} <!-- not bound once... -->
</div>

Demo Time!

How bad is it?
And how to use it?

Resources


The magic commit


Speeding up AngularJS apps with simple optimizations by Todd Motto


bindonce module by Pasvaz


Thanks!


Questions?

Kent C. Dodds
@kentcdodds

angular-bindonce

By Kent C. Dodds

angular-bindonce

Utilizing Angular 1.3 one time binding functionality

  • 1,421
Loading comments...

More from Kent C. Dodds