Skip to content

Commit d88ca49

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
fix(core): call safeDetectChanges in CommonDirective instead of calling detectChanges()
1 parent f65807c commit d88ca49

File tree

1 file changed

+2
-1
lines changed
  • libs/angular-three/src/lib/directives

1 file changed

+2
-1
lines changed

libs/angular-three/src/lib/directives/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Directive, EmbeddedViewRef, inject, NgZone, TemplateRef, ViewContainerRef } from '@angular/core';
22
import { SPECIAL_INTERNAL_ADD_COMMENT } from '../renderer/utils';
3+
import { safeDetectChanges } from '../utils/safe-detect-changes';
34

45
@Directive()
56
export abstract class NgtCommonDirective {
@@ -28,7 +29,7 @@ export abstract class NgtCommonDirective {
2829
}
2930
this.#zone.runOutsideAngular(() => {
3031
this.#view = this.#vcr.createEmbeddedView(this.#template);
31-
this.#view.detectChanges();
32+
safeDetectChanges(this.#view);
3233
});
3334
}
3435
}

0 commit comments

Comments
 (0)