From fc17700e7dc5f6389b08e0ca335518589796a693 Mon Sep 17 00:00:00 2001 From: gautamjajoo Date: Sun, 25 Jul 2021 23:00:01 +0530 Subject: [PATCH 1/3] fix change in expression value --- .../publiclists/publiclists.component.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/frontend_v2/src/app/components/publiclists/publiclists.component.ts b/frontend_v2/src/app/components/publiclists/publiclists.component.ts index 5bf8ba6653..bd4c45535d 100644 --- a/frontend_v2/src/app/components/publiclists/publiclists.component.ts +++ b/frontend_v2/src/app/components/publiclists/publiclists.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Inject, OnDestroy } from '@angular/core'; +import { Component, OnInit, Inject, OnDestroy, AfterViewChecked, ChangeDetectorRef } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { DOCUMENT } from '@angular/common'; import { GlobalService } from '../../services/global.service'; @@ -12,7 +12,10 @@ import { AuthService } from '../../services/auth.service'; templateUrl: './publiclists.component.html', styleUrls: ['./publiclists.component.scss'], }) -export class PubliclistsComponent { +export class PubliclistsComponent implements AfterViewChecked { + + isAuth = false; + /** * Constructor. * @param document Window document Injection. @@ -26,6 +29,20 @@ export class PubliclistsComponent { private route: ActivatedRoute, @Inject(DOCUMENT) private document: Document, public authService: AuthService, - private globalService: GlobalService + private globalService: GlobalService, + private cdRef : ChangeDetectorRef ) {} + + /** + * DEV MODE: + * For resolving change in expression value after it is checked + */ + + ngAfterViewChecked() { + let isAuth = this.authService.isAuth; + if(isAuth != this.isAuth) { + this.isAuth = isAuth; + this.cdRef.detectChanges(); + } + } } From f342d9c19aaed4ccbeadbfad8e5be9969461530e Mon Sep 17 00:00:00 2001 From: gautamjajoo Date: Tue, 27 Jul 2021 12:56:10 +0530 Subject: [PATCH 2/3] assign value on component initialization --- .../components/publiclists/publiclists.component.html | 8 ++++---- .../components/publiclists/publiclists.component.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend_v2/src/app/components/publiclists/publiclists.component.html b/frontend_v2/src/app/components/publiclists/publiclists.component.html index ae92d8104b..7e691924c8 100644 --- a/frontend_v2/src/app/components/publiclists/publiclists.component.html +++ b/frontend_v2/src/app/components/publiclists/publiclists.component.html @@ -1,13 +1,13 @@ - + -
+
- +
- + diff --git a/frontend_v2/src/app/components/publiclists/publiclists.component.ts b/frontend_v2/src/app/components/publiclists/publiclists.component.ts index bd4c45535d..cdee30625d 100644 --- a/frontend_v2/src/app/components/publiclists/publiclists.component.ts +++ b/frontend_v2/src/app/components/publiclists/publiclists.component.ts @@ -12,7 +12,7 @@ import { AuthService } from '../../services/auth.service'; templateUrl: './publiclists.component.html', styleUrls: ['./publiclists.component.scss'], }) -export class PubliclistsComponent implements AfterViewChecked { +export class PubliclistsComponent implements OnInit, AfterViewChecked { isAuth = false; @@ -32,7 +32,13 @@ export class PubliclistsComponent implements AfterViewChecked { private globalService: GlobalService, private cdRef : ChangeDetectorRef ) {} - + + /** + * Component on Initialization. + */ + ngOnInit() { + this.isAuth = this.authService.isAuth; + } /** * DEV MODE: * For resolving change in expression value after it is checked From b8c095e5d7abb190c517f1224bb5a675a8224338 Mon Sep 17 00:00:00 2001 From: gautamjajoo Date: Thu, 5 Aug 2021 21:13:56 +0530 Subject: [PATCH 3/3] add line --- .../src/app/components/publiclists/publiclists.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend_v2/src/app/components/publiclists/publiclists.component.ts b/frontend_v2/src/app/components/publiclists/publiclists.component.ts index cdee30625d..6edd4ea79d 100644 --- a/frontend_v2/src/app/components/publiclists/publiclists.component.ts +++ b/frontend_v2/src/app/components/publiclists/publiclists.component.ts @@ -39,11 +39,11 @@ export class PubliclistsComponent implements OnInit, AfterViewChecked { ngOnInit() { this.isAuth = this.authService.isAuth; } + /** * DEV MODE: * For resolving change in expression value after it is checked */ - ngAfterViewChecked() { let isAuth = this.authService.isAuth; if(isAuth != this.isAuth) {