Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Angular 1.x binding limits

Angular 1.x binding limits

A bit of practical look into Angular performance issues and some ways to avoid it by using mechanisms by Angular, JavaScript itself and common sense.
Presentet at Angular Munich Meetup #5:
http://www.meetup.com/AngularJS-Munich/events/222268338

Zlatko

May 21, 2015
Tweet

More Decks by Zlatko

Other Decks in Programming

Transcript

  1. Problem • Thousands of lines to parse on each letter

    change • Thousands of nodes to update • Slow initial load, slow response to changes • Eats nerves at superfast rates
  2. The story of live bindings • Two-way binding = biggest

    practical value But ... • $apply = $digest + more • $digest = lots of work • ng-bind ({{thisStuff}}), ng-model, $scope.anything
  3. Hook it up right away • $compile runs once •

    $link runs on each $iteration • ng-transclude – limits scope • Repeated dirty-checks ! 2 + 2 = smart
  4. Takeaways Reduce number of dirty checks == <3 FTW Kit

    : • `compile` instead of `link` • `ng-once` • `bind-on-notify` and `bind-notifier` • `ng-repeat` track by, $watchCollection • be smart
  5. En : "Thank you for your attention." De : "Willst

    du mir ein Bier kaufen?" Translation help, please !