Brian Ford - Zones - NG-Conf 2014

AI Dev Craft · 144K views · 2014 · 16:35

Open on YouTube

Web developmentPython, Ruby & scripting languagestalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about Angular 2 change detection, zone.js, and why UI updates happen after setTimeout or promise callbacks.

Recommended by 4 people across 3 different months, 2015 to 2019.

What it is

A 16-minute talk from ng-conf 2014 in which Brian Ford of the Angular team explains Zones (zone.js), a mechanism that wraps asynchronous browser APIs so code can hook into their start and finish. The talk covers how this underpins automatic change detection in Angular 2.

What people said

Recommends Thierry Templier · 2015-12 · Stack Overflow · on “Angular2, view not updating after variable changes in settimeout”

As Vlado said, it should work ;-) I think that the angular2-polyfills.js library should be included into your page. I can't see it. This file is essentially a mashup of zone.js and reflect-metadata. Zones take part of the detection of updates. You could have a look at this video where Bryan Ford explains what it is: [this video] . Hope it helps you, Thierry

Recommends Mark Rajcok · 2016-01 · Stack Overflow · on “What is the Angular equivalent to an AngularJS $watch?”

In Angular 2, change detection is automatic... $scope.$watch() and $scope.$digest() R.I.P. Unfortunately, the Change Detection section of the dev guide is not written yet (there is a placeholder near the bottom of the Architecture Overview [LINK] page, in section "The Other Stuff"). Here's my understanding of how change detection works: Zone.js "monkey patches the world" -- it intercepts all of the asynchronous APIs in the browser (when Angular runs). This is why we can use setTimeout() inside our components rather than something like $timeout ... because setTimeout() is monkey patched. Angular builds and maintains a tree of "change detectors". There is one such change detector (class) per c

Recommends UtsavShah · 2016-01 · Stack Overflow · on “How does angular2 detect the changes in a stateful pipe?”

To understand this, I think it's probably best to look at the talk on Zone.js [this video] . Basically angular uses a library called zone to do a $rootScope digest after a setTimeout call completes (if it needs to) Not only that, even after any promise resolution, a digest cycle is triggered. This is precisely because it doesn't know which properties might have changed, so it dirty checks the entire app.

Recommends laser · 2017-02 · Stack Overflow · on “How to implement the change menu in angular 2”

@Alexander there are many useful tutorials on that, basically I would suggest two of them: 1) [this video] this is really great, then closer to angular2 as it is now: 2) [LINK]

Cites wolfhoundjesse · 2016-06 · Stack Overflow · on “Angular 2 failure to load resources”

I was a newbie, too. A polyfill is basically a translator that enables you to use new features before they are supported (or use really old things that no one wants to support, ha!). Here are some links that helped me to get a grasp on these additional libraries: LearnRx [LINK] RxJs 5 Operators by Example [LINK] Zones with Brian Ford - NG Conf 2014 [this video]

Cites Sunny Goel · 2019-03 · Stack Overflow · on “Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?”

If I talk from top then the meaning of this warning is that the event is triggered outside of zone. Angular uses zones , also called execution contexts for change detection and UI rendering . So while navigating , Angular expects to re-renderer the UI but it is not happening here. That's the problem you are facing. So it throws this warning because Angular is processing the change detection and UI rendering when the code executed lies inside of Angular zone. But actually, this warning comes when you are trying to call the router navigation inside the subscribe method. If you put your router navigation call outside of subscribe method then it will not throw this warning again and you will see