我在Angular 6项目中有很多rx.js订阅。太不公平了。无论如何,其中之一会在鼠标移动后产生对updateDirectives
的调用。这会使应用程序减慢太多。
所以我有一个调用栈和调试器。如何找到导致updateDirectives
的订阅。
调用堆栈为
push../src/app/pipes/filter.pipe.ts.FilterPipe.transform (x:\my_proj\src\app\pipes\filter.pipe.ts:9)
(anonymous function) (uiOCrCitites.ngfactory.js:255)
updateDirectives (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20175)
checkAndUpdateView (x:\my_proj\node_modules\@angular\core\fesm5\core.js:19828)
callViewAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20069)
execComponentViewsAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20011)
checkAndUpdateView (x:\my_proj\node_modules\@angular\core\fesm5\core.js:19834)
callViewAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20069)
execComponentViewsAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20011)
checkAndUpdateView (x:\my_proj\node_modules\@angular\core\fesm5\core.js:19834)
callViewAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20069)
execEmbeddedViewsAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20032)
checkAndUpdateView (x:\my_proj\node_modules\@angular\core\fesm5\core.js:19829)
callViewAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20069)
execComponentViewsAction (x:\my_proj\node_modules\@angular\core\fesm5\core.js:20011)
checkAndUpdateView (x:\my_proj\node_modules\@angular\core\fesm5\core.js:19834)
push../node_modules/@angular/core/fesm5/core.js.ViewRef_.detectChanges (x:\my_proj\node_modules\@angular\core\fesm5\core.js:18209)
(anonymous function) (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14871)
push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14871)
(anonymous function) (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14762)
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (x:\my_proj\node_modules\zone.js\dist\zone.js:388)
onInvoke (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14143)
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (x:\my_proj\node_modules\zone.js\dist\zone.js:387)
push../node_modules/zone.js/dist/zone.js.Zone.run (x:\my_proj\node_modules\zone.js\dist\zone.js:138)
push../node_modules/@angular/core/fesm5/core.js.NgZone.run (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14057)
next (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14762)
schedulerFn (x:\my_proj\node_modules\@angular\core\fesm5\core.js:10238)
push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (x:\my_proj\node_modules\rxjs\_esm5\internal\Subscriber.js:196)
push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (x:\my_proj\node_modules\rxjs\_esm5\internal\Subscriber.js:134)
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (x:\my_proj\node_modules\rxjs\_esm5\internal\Subscriber.js:77)
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (x:\my_proj\node_modules\rxjs\_esm5\internal\Subscriber.js:54)
push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (x:\my_proj\node_modules\rxjs\_esm5\internal\Subject.js:47)
push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (x:\my_proj\node_modules\@angular\core\fesm5\core.js:10222)
checkStable (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14112)
onLeave (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14179)
onInvokeTask (x:\my_proj\node_modules\@angular\core\fesm5\core.js:14137)
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (x:\my_proj\node_modules\zone.js\dist\zone.js:420)
push../node_modules/zone.js/dist/zone.js.Zone.runTask (x:\my_proj\node_modules\zone.js\dist\zone.js:188)
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (x:\my_proj\node_modules\zone.js\dist\zone.js:496)
invokeTask (x:\my_proj\node_modules\zone.js\dist\zone.js:1540)
globalZoneAwareCallback (x:\my_proj\node_modules\zone.js\dist\zone.js:1566)