Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does the by service way work? #4

Open
cubika opened this issue Jun 12, 2015 · 1 comment
Open

How does the by service way work? #4

cubika opened this issue Jun 12, 2015 · 1 comment

Comments

@cubika
Copy link

cubika commented Jun 12, 2015

For example, if FriendInput add an item to FriendsService, how does it notify FriendList that an item is added? I notice that no explicit call were made when new item added.

@SekibOmazic
Copy link
Owner

Right, there is no explicit call to notify FriendList that something has changed. There is also no $watch or something similar in FriendList that registers a callback handler.

In Angular 2 it all works automatically. Behind the scenes you have Zone.js that intercepts all asynch calls and triggers Angular's change detection.

The short (but good) description of what Zone.js does for Angular could be read here:
https://github.com/angular/angular/blob/master/modules/angular2/docs/core/12_zones.md

Cheers ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants