Which means "It is not expected to be in the Angular zone, but it is!" does the error mean?

I started getting this error after upgrading from Angular 2 RC4 to RC5. This does not seem to affect the behavior of the application, but it is written to the console and can be distracted from other errors, etc.

Can anyone give some troubleshooting tips?

+6
source share
1 answer

This is an old question; however, since it was appearing among Google answers when I was looking for a solution for the same console message, I will leave here what worked for me.

The code I'm working with was originally created using AngularJS, but later development switched to Angular2. When the application loads, the bootstrap call is made using the UpgradeAdapter, and apparently this was the problem.

What I did was import NgZone from @ angular / core and use the runOutsideAngular method to make the boot call. As soon as I did this, the error message disappeared. Example:

this.zone.runOutsideAngular(() => { performBootstrapCall(); }); 
+1
source

All Articles