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
0
votes
0 answers

Angular Observable make navigation outside NgZone

I got a problem with an observable and navigation. Here is my login function: submit() { const loginSubscr = this.authService .login(this.loginForm.get('username').value, this.loginForm.get('password').value) .pipe(first()) .subscribe((user:…
MatDepInfo
  • 317
  • 3
  • 16
0
votes
1 answer

Angular 2 Lifecycle Hooks, change detection and ngZone

I have an Angular app where the user presses a button and trigger an animation. Basically it's two pictures switching with each other to create a running illusion. At first my character is still then as we start to play, its pictures animate, but as…
HomeAlone
  • 161
  • 1
  • 12
0
votes
1 answer

Getting 'this._ngZone is undefined' error in StackBlitz

I'm trying to run an angular app inside StackBlitz. It was working fine, until I tried adding a mat-sidenav-container. Then the app started failing with the following error displayed in the console: ERROR Error: this._ngZone is undefined Here's…
Eternal21
  • 4,190
  • 2
  • 48
  • 63
0
votes
1 answer

How to trace 'Navigation triggered outside Angular zone' to origin, it it's possible

My Angular 11 application triggers this warning in console: Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'? core.js:27937 Is there a way to trace that warning to the point in my code that might…
VBobCat
  • 2,527
  • 4
  • 29
  • 56
0
votes
0 answers

Angular prevent external library to trigger change detection

I understand that when Angular finds this code in a component @HostListener('window:keyup') handler(event) { ... } it attaches handler to the global event listener and every time a keyup event is fired it invokes handler and then triggers…
user4209634
0
votes
0 answers

Click event on map not reloading the geometry polygon Angular 10, ArcGIS 4.16

I have an arcGIS map in angular 10. The polygon is plotting on the map based on the wkid and the projected ring values. I need to re draw the polygon when click on the map. click event collect the ID from the map with the hottest() and I need to…
Adam-KER
  • 67
  • 9
0
votes
1 answer

Subscribe not working even in NgZone.run()

I read articles on how to use NgZone in angular. But still I'm not able to enter subscribe in the first call of execution. Please help me with this. Thanks in advance :) constructor(private _apicallservice: ApiCallService, private _ngzone : NgZone)…
0
votes
1 answer

Angular 9 refresh component after callback received on service

I'm new in Angular and also a bit lost. I'm trying to implement the google sign on in an angular app but i cannot make it work. The idea is to show the sign in button and once the user has completed it, refresh the component showing his data and…
Acampoh
  • 589
  • 1
  • 8
  • 23
0
votes
1 answer

ERROR Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' even when returning an observable

I found few questions with same title and, as far as I could see, some of them are suggesting that the solution is basically return an Observable instead of an array (others are about FireBase which isn't my case). Well, as far I am concern, the…
Jim C
  • 3,957
  • 25
  • 85
  • 162
0
votes
1 answer

Ionic4 ion-slide, not working property when loop config is on

With simple reproduction config = { ... loop: true, ... }
Content goes here
clickMe() { …
Liu Zhang
  • 1,808
  • 19
  • 31
0
votes
1 answer

Mock Router and Ngzone in Angular 7 Jest Unit test

I used ngzone and router in component class. My unit testing was working fine but now getting error cannot read toLowerCase() of undefined. Can anyone suggest me how to mock both Ngzone and Router.
sushil sinha
  • 61
  • 1
  • 5
0
votes
1 answer

Retain UI Element position when model updates using Angular cdkDrag

Within a view I have a component that is using Angular cdkDrag to move elements around on a dashboard. The data to this component is pass down from the parent (via single way binding) which is subscribed to a SignalR Hub. The issue I am having is…
0
votes
0 answers

runOutsideAngular issue with components having ChangeDetectionStrategy.OnPush

I'm using below directive for Swipe left and Swipe right gestures in an Angular app. import { Directive, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, Output, Input } from '@angular/core'; import { fromEvent, Observable } from 'rxjs'; import…
0
votes
1 answer

session timeout using ngzone angular 7

I have used the below code for timeout. When I login and stay inactive for 1 hour then the timeout is working successfully and the user is getting logout. But when I login and close the browser and come back after 1 hour and open the application in…
rji rji
  • 697
  • 3
  • 17
  • 37
0
votes
1 answer

Using back button and then clicking routerLink results in error

In a cordova app wrapping an angular app, after I click the back button, it seems that the app is no longer in the "angular zone", so if I click on any routerlink afterwards it do nothing and throw the error Navigation triggered outside Angular…
Philip
  • 638
  • 1
  • 8
  • 22