From b9e7a4801d7a427eef671402e717a92eb608d014 Mon Sep 17 00:00:00 2001 From: Hayk Date: Sat, 20 Jan 2024 11:11:24 +0400 Subject: [PATCH] Fixed 'expression has changed after it was checked in loading component' issues --- src/app/shared/layout/layout.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/shared/layout/layout.component.ts b/src/app/shared/layout/layout.component.ts index 9f5094f..8f8662b 100644 --- a/src/app/shared/layout/layout.component.ts +++ b/src/app/shared/layout/layout.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ChangeDetectorRef, OnDestroy, AfterViewInit } from '@angular/core'; +import { Component, OnInit, ChangeDetectorRef, OnDestroy, AfterViewInit, AfterContentChecked } from '@angular/core'; import { MediaMatcher } from '@angular/cdk/layout'; import { timer } from 'rxjs'; import { Subscription } from 'rxjs'; @@ -12,7 +12,7 @@ import { AuthGuard } from 'src/app/core/guards/auth.guard'; templateUrl: './layout.component.html', styleUrls: ['./layout.component.css'] }) -export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit { +export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked { private _mobileQueryListener: () => void; mobileQuery: MediaQueryList; @@ -56,4 +56,8 @@ export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit { ngAfterViewInit(): void { this.changeDetectorRef.detectChanges(); } + + ngAfterContentChecked(): void { + this.changeDetectorRef.detectChanges(); + } }