angular2-social-login
angular2-social-login copied to clipboard
FB.api() breaks Angular change detection
trafficstars
It seems that FB.api() adds a script to the page and executes a callback (which eventually executes your callback). Since this added script is run outside the Angular zone, you callback is too, which makes changes not visible to Angular.
To fix this, can you please add ngZone.run() wrapper like so:
FB.api('/me', () => {
// This is run outside the Angular zone. We need to get back in.
this.ngZone.run(() => {
... your code ...
});
});
Thanks