Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何知道Zone.js何时运行以及在何处触发以进行调试?_Angular_Zone.js - Fatal编程技术网

Angular 如何知道Zone.js何时运行以及在何处触发以进行调试?

Angular 如何知道Zone.js何时运行以及在何处触发以进行调试?,angular,zone.js,Angular,Zone.js,我在一个Angular应用程序上工作,该应用程序使用多个第三方库(传单/wijmo/d3/) 对于性能,我已经在几乎所有地方使用了cdRef.OnPush 为了防止区域运行过多,我在一些特定组件中使用了Zone.runOutsideAngular(),但我看到了一些奇怪的行为,我想了解更多触发区域的时间和位置(在我的代码中) 你知道怎么记录吗 [angular@5.2.3&区域。js@0.8.19]您可以使用NgZone.onStable @Component { ... } export

我在一个Angular应用程序上工作,该应用程序使用多个第三方库(传单/wijmo/d3/)

对于性能,我已经在几乎所有地方使用了
cdRef.OnPush

为了防止区域运行过多,我在一些特定组件中使用了
Zone.runOutsideAngular()
,但我看到了一些奇怪的行为,我想了解更多触发区域的时间和位置(在我的代码中)

你知道怎么记录吗


[
angular@5.2.3
&
区域。js@0.8.19
]

您可以使用NgZone.onStable

@Component {
  ...
} 
export class AppComponent {
  constructor (private ngZone: NgZone) {
    this.ngZone.onStable.subscribe(() => {console.log('zone stableed')});
  }
}

不确定你的问题,但也许这是一本关于这个主题的好读物:谢谢,我已经读过了,但这不是我想要的。我想记录何时触发以及从何处调试应用程序。你说触发Zone是什么意思?@jialipassion我指的是Zone检测到异步代码的时间和内容,它告诉Angular运行更改检测。谢谢,使用
onStable
&
oninstable
可观测值,我得到了我想要的东西,但在我的代码中找到它的来源并不是一件容易的事!:)