Skip to content

Commit

Permalink
assign value on component initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamjajoo committed Jul 27, 2021
1 parent fc17700 commit f342d9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<app-side-bar *ngIf="authService.isAuth"></app-side-bar>
<app-side-bar *ngIf="isAuth"></app-side-bar>
<app-header-static></app-header-static>
<div class="web-container" [class.center]="!authService.isAuth">
<div class="web-container" [class.center]="!isAuth">
<div class="dashboard-flex">
<div class="dashboard-content">
<router-outlet></router-outlet>
</div>
<app-footer [isDash]="true" *ngIf="authService.isAuth"></app-footer>
<app-footer [isDash]="true" *ngIf="isAuth"></app-footer>
</div>
</div>
<div class="clearfix"></div>

<app-footer *ngIf="!authService.isAuth"></app-footer>
<app-footer *ngIf="!isAuth"></app-footer>
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit f342d9c

Please sign in to comment.