Questions tagged [ngzone]

Any question related to ngZone and change detection cycle of Angular framework can use this tag

  1. Any question related to Change Detection cycle using NgZone can add this tag

  2. NgZone is derived from zone.js but NgZone is specifically being used by Angular framework to manage its "Change Detection" cycle.

  3. This tag should not be used if the question is related to zone.js and has nothing to do with Angular framework

72 questions
2
votes
1 answer

Change Detection not working Properly after Adding web component build with Angular 9 with NOOP

We created a Web Component with Angular Elements built with v9. Applying noop on ngZone when bootstrapping the module. platformBrowserDynamic() .bootstrapModule(AppModule, { ngZone: 'noop' }) Create a script that concatenates core-js…
2
votes
0 answers

No Angular interpolation when ngZone is noop

I understand that if I set ngZone to 'noop' in the main.ts file, I'll have to manually detect changes in the component. How do I manually detect changes in this case? I want to update my formDataIncome value to change the data in a graph (which…
MacD
  • 566
  • 3
  • 9
  • 27
2
votes
2 answers

Call ChangeDetectorRef.detectChanges from runOutsideAngular context. Is it ok?

Is it ok to call ChangeDetectorRef.detectChanges from NgZone.runOutsideAngular context? I have angular app that receives data via WebSocket. Websocket datastream is so intensive thereby I wrapped it into NgZone.runOutsideAngular. Various services…
2
votes
1 answer

Execution order of multiple setTimeout without delays in angular

What is the execution order of multiple setTimeout without delays in angular2+? Example: setTimeout(() => console.log('1')); setTimeout(() => console.log('2')); Questions: (1) Is 1 always guaranteed to be printed before 2? (2) If so, what part of…
Hossam El-Deen
  • 972
  • 1
  • 13
  • 27
2
votes
0 answers

How to sync database and angular component?

I am trying to fetch data continuously from mongo database. It needs refresh the page in order to get latest data. My question, Is there any way to put angular service and component which will check & fetch data in real time? Some of the way which i…
uday214125
  • 569
  • 1
  • 8
  • 22
2
votes
2 answers

Angular change detection slow

I have a large array that I am using in a component (component A) with *ngFor with a nested *ngFor. Component B initialises a jquery plugin which registers a document mousemove event handler, I am using this.zone.runOutsideAngular to init the plugin…
raygerrard
  • 812
  • 11
  • 13
2
votes
0 answers

How to limit change detection on XHR in hybrid AngularJS and Angular 5 application

I have a rather large hybrid AngularJS / Angular application that I upgraded from Angular 4 to Angular 5 to get rid of the UpgradeModule that caused excessive $digests and slowness. But now I noticed that on every AngularJS XHR request Angular 5…
JGoodgive
  • 1,068
  • 10
  • 20
2
votes
0 answers

ionic 2 use zone Ngzone()

hi i try to use Zone on my ionic2 app : i create a provider who take location of my device import { Injectable,NgZone } from '@angular/core'; import { Geolocation, Geoposition } from '@ionic-native/geolocation'; import…
fansz
  • 231
  • 1
  • 4
  • 9
1
vote
1 answer

Generic component where projected content is instantiated in outer zone

I have a webcomponent that for perf reasons needs to run outside angular. I came up with the basic idea : @Component({ selector: 'run-outer-zone', template: '' }) class OuterZoneComponent { constructor(private vcr: ViewContainerRef, private…
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
1
vote
1 answer

Angular change detection runs unexpectedly, based on the expressions order in the view

I am just playing with Angular change detection cycle and I found something that I can't understand. We have following component's view:

call(); {{ call() }}

Name obtained from the API: {{…
1
vote
1 answer

Angular @Input value not changing when changed from Parent Component

I have added same child component three times in a single parent component And below is the change function called on one of the children's components to change the selectedName in other two child components The @Input is type of string if I change…
RS Roshi
  • 53
  • 1
  • 6
1
vote
1 answer

ngOnInit is not working when the server send event service used in multiple componenets

I created a service for getting SSE(server send events) from backend(Node). When I use this service in one component it's working as expected. But when I try to use in multiple components at very first time ngoninit triggers and loads the data…
1
vote
1 answer

Angular8+ ngswitch nested component doesn't update the view

I have the strange issue with component view rendering. Part of the component i work on looks like this:
Comp2 uses some shared…
valentin.mu
  • 93
  • 1
  • 8
1
vote
0 answers

Updating DOM before and after heavy blocking calculations

When doing some synchronous actions that contain heavy calculations, showing something before and after might be a problem. Component template:
Service @Injectable() export class…
Tukkan
  • 1,574
  • 2
  • 18
  • 33
1
vote
0 answers

change detection ;application.tick is recursively called ? why

i have a parent component A and child component b and service c for loading the loading pop up service in success and failure. Have a button called as newchanges in B child component and b component emit the value and call the function in a…
Mohamed Sahir
  • 2,482
  • 8
  • 40
  • 71