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