Questions tagged [zonejs]

Implements Zones for JavaScript

Links

127 questions
125
votes
7 answers

Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?

I am using Angular 7 and facing an issue => after login the API GET calls successfully and the component receiving data too, but UI is not displaying that data. When I open the browser console, immediately the data gets populated on the UI and a…
Er Vipin Sharma
  • 2,519
  • 8
  • 22
  • 32
42
votes
5 answers

angular 2 change detection and ChangeDetectionStrategy.OnPush

I'm trying to understand the ChangeDetectionStrategy.OnPush mechanism. What I gather from my readings is that a change detection works by comparing the old value to the new value. That comparison will returns false if the object reference hasn't…
Ced
  • 15,847
  • 14
  • 87
  • 146
32
votes
6 answers

Angular2 Final Release - "Error: Angular requires Zone.js prolyfill"

I have upgraded from RC4 to the Final release of Angular2. When I run npm start, the app is stuck on 'Loading...' the only error I get is about Zone.js: Basically, typeof Zone is undefined: Here is my package.json: "engines": { "node": ">=…
jhhoff02
  • 1,179
  • 1
  • 17
  • 24
27
votes
1 answer

zone.js violation warnings on console in Angular project only on Chrome

I've an Angular 4 project created using @angular/cli, when running the application in development mode, I receive those warnings in the console: zone.js:1489 [Violation] 'setTimeout' handler took 209ms 2[Violation] Added non-passive event listener…
Ahmed Abdelrahman
  • 778
  • 3
  • 12
  • 30
26
votes
8 answers

Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'

This is a bad thursday. It is the 13th. And yesterday I explained to my collegues how lucky we were about the 13th falling on a thursday, not on a friday. Well, that was yesterday, and today I woke up with angular's fist in my face: Cannot create…
Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92
25
votes
5 answers

How to track which async tasks protractor is waiting on?

I have a medium sized Angular application and for some reasons some of my protractor tests are timing out when run against my live production environment. I am fairly sure the timeouts happen because of protractor waiting on some asynchronous task.…
magnattic
  • 12,638
  • 13
  • 62
  • 115
24
votes
3 answers

should I care about "Zone.js does not support native async/await in ES2017."?

After upgrading from Angular 9 to 10 I get these warnings when I run ng serve: WARNING: Zone.js does not support native async/await in ES2017. These blocks are not intercepted by zone.js and will not triggering change detection. See:…
Jørgen Rasmussen
  • 1,143
  • 14
  • 31
23
votes
7 answers

Angular 4 display current time

What is the correct (canonical) way to display current time in angular 4 change detection system? The problem is as follows: current time changes constantly, each moment, by definition. But it is not detectable by Angular 4 change detection system.…
BOPOHOB
  • 525
  • 1
  • 4
  • 13
17
votes
3 answers

Zone.assertZonePatched is not a function

I am getting the error message: Unhandled Promise rejection: Zone.assertZonePatched is not a function Although I am importing zonejs correctly in index.html: Here is the…
Gambo
  • 1,572
  • 3
  • 26
  • 52
12
votes
2 answers

angular2 understanding VM turns and events

I've just started going into the Angular2 change detection mechanism. I've read Thoughram's blog posts on the subject (the ones on ZoneJS and on Angular2 zones) but still there's 1 term I can't find any definition for. Here's an excerpt from this…
Avi Sasson
  • 666
  • 7
  • 22
8
votes
1 answer

WebRTC does not work in Angular 5 on iOS Safari

I'm building an app with WebRTC and it's not working in Angular 5 on iOS Safari. I use native WebRTC API, no framework. First without Angular To prove my point Angular is the problem, I did a WebRTC test with plain html and javascript. So I had an…
Herman Fransen
  • 2,200
  • 5
  • 24
  • 40
8
votes
5 answers

How to only load Zone.js when it is needed

I'm creating an Angular 2 application that can be dynamically injected into a running website. The point of this app is to be able to modify the website content visually. Everything works as expected when the website in question does not also run…
martindzejky
  • 389
  • 1
  • 3
  • 15
8
votes
2 answers

Change detection isn't run properly in Firefox

In Chrome, everything works, but in Firefox, the bindings are never updated. It seems like the problem has to do with core-js and/or…
Maxime Dupré
  • 5,319
  • 7
  • 38
  • 72
8
votes
3 answers

Custom error handler in Zone.js

I've been working with Zone.js and I want to set up logging for any uncaught exceptions. I could set up an error handler, like so: window.onerror = function(e) { //send an error report to the server } But this won't work if an exception is…
Owen K.
  • 81
  • 1
  • 3
8
votes
3 answers

How can I "monkey patch" an Observable for Zone.js?

I'm creating an Angular 2 component, and Angular's change detection isn't working for me when using a certain Observable pattern. It looks something like this: let getResult$ = this.http.get('/api/identity-settings'); let manager$ =…
StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
1
2 3
8 9