[angular-18 | DONE | REMOVED] Remove not needed this.cdr.detectChanges(); for performance issues
This commit is contained in:
parent
c8e4d62e6b
commit
97c5fbf155
|
@ -170,8 +170,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
@Inject(DOCUMENT) private document,
|
||||
private transferState: TransferState,
|
||||
@Inject(PLATFORM_ID) private platformId: any,
|
||||
private rendererFactory: RendererFactory2,
|
||||
private cdr: ChangeDetectorRef
|
||||
private rendererFactory: RendererFactory2
|
||||
) {
|
||||
this.subscriptions.push(router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
|
@ -212,13 +211,11 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
this.subscriptions.push(this.layoutService.hasQuickContact.subscribe(hasQuickContact => {
|
||||
if (this.showQuickContact !== hasQuickContact) {
|
||||
this.showQuickContact = hasQuickContact;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
}));
|
||||
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
|
||||
if (this.displayQuickContact !== display) {
|
||||
this.displayQuickContact = display;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -248,7 +245,6 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
entries.forEach(entry => {
|
||||
if (this.bottomNotIntersecting !== (!entry.isIntersecting)) {
|
||||
this.bottomNotIntersecting = !entry.isIntersecting;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
});
|
||||
}, options);
|
||||
|
|
Loading…
Reference in New Issue