Does notifyWhenNoOutstandingRequests or an equivalent exist in Angular 2?

荒凉一梦 提交于 2020-01-06 03:05:03

问题


I have seen this used by test frameworks (for example, Arquillian) to detect when the dom is ready to be examined with Angular 1. Is there an equivalent way to do this in angular 2?


回答1:


onEventDone from NgZone should work for that

Notifies subscribers immediately after the final onTurnDone callback before ending VM event.

This event is useful for validating application state (e.g. in a test).

https://angular.io/api/core/NgZone



来源:https://stackoverflow.com/questions/35926126/does-notifywhennooutstandingrequests-or-an-equivalent-exist-in-angular-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!