zonejs

Angular - Getting out of Zone.JS for specific callbacks

倖福魔咒の 提交于 2021-02-10 14:25:43
问题 First and foremost, I'm well aware of zone.runOutsideAngular(callback) , documented here . What this method does is running the callback in a different zone than the Angular one. I need to attach a very quick callback to document 's mousemove event (to count Idle time). I don't want to have the whole Zone.JS machinery of tasks appended to execution queues for this specific callback. I would really like to have the callbacks run in plain, unpatched browser runtime. The event registration code

How to track which async tasks protractor is waiting on?

戏子无情 提交于 2020-03-17 05:13:51
问题 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. I know about zones and I tried to keep all long running async tasks out of the ngZone (as per the FAQ), but for some reason protractor is still timing out. It's possible I missed something but I don't know how to debug the problem. Is there any way

Slow performance in hybrid AngularJS and Angular application in Safari

…衆ロ難τιáo~ 提交于 2020-01-24 10:12:04
问题 I have started recently the migration of an AngularJS application to Angular 4 using the upgrade module. One of my AngularJS directives uses a third party library (ngFlow) to upload files using XMLHttpRequest.send() . When running in hybrid mode, uploads work fine both, in Chrome and in Firefox. However, in Safari the app becomes very slow during an upload and the browser process reaches 100% CPU used. Using Safari web tools, I see that there is a lot of calls to globalZoneAwareCallback from

Angular 4 display current time

随声附和 提交于 2019-12-31 20:43:34
问题 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. For this reason, in my opinion, it's necessary to explicitly call ChangeDetectorRef::detectChanges . However, in the process of calling this method, current time naturally changes its value. This leads to ExpressionChangedAfterItHasBeenCheckedError

Angular 4 display current time

橙三吉。 提交于 2019-12-31 20:41:26
问题 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. For this reason, in my opinion, it's necessary to explicitly call ChangeDetectorRef::detectChanges . However, in the process of calling this method, current time naturally changes its value. This leads to ExpressionChangedAfterItHasBeenCheckedError

Angular 4 + zonejs: routing stops working after uncaught error

牧云@^-^@ 提交于 2019-12-22 04:56:08
问题 If there is an uncaught error from a component (constructor or ngOnInit) during routing the navigation won't work anymore afterwards. This happens even if there is an global ErrorHandler and an ErrorHandler for the RouterModule, added an ZoneListener to be sure as well - see app.module.ts Minimal example here: https://embed.plnkr.co/L19S3hKWyqgKUIT1EJlI/preview Make sure to open the console. Once you clicked "Example Component" there are some stacktraces as a result of the forced error in

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

那年仲夏 提交于 2019-12-20 11:01:43
问题 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 warning is showing in the console. "core.js:15686 Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?" I have googled this warning and found some workaround like this.ngZone.run() and call my API's inside it. But the

WebRTC does not work in Angular 5 on iOS Safari

亡梦爱人 提交于 2019-12-18 05:09:23
问题 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 index.html and a my-webrtc.js . <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>WebRTC Test</title> </head> <body> <div> <video id="local-video" playsinline autoplay muted></video> <video id="remote-video" playsinline autoplay></video> <