angular2-meteor icon indicating copy to clipboard operation
angular2-meteor copied to clipboard

Sidebar and navbar are not rendering if the page is not refreshed angular2

Open chandra329706 opened this issue 8 years ago • 0 comments

In the below code, sidebar and navbar are not being rendered if the page is not refreshed.

Component:

import { Component, OnInit } from '@angular/core'; import {Router} from "@angular/router";

@Component({ selector: 'app-layout', templateUrl: './layout.component.html', styleUrls: ['./layout.component.css'] }) export class LayoutComponent implements OnInit { constructor(private _router : Router) { } IsLoggedIn : boolean = false; ngOnInit() { if(localStorage.getItem('currentUserId')) this.IsLoggedIn = true; } }

HTML

chandra329706 avatar Aug 09 '17 13:08 chandra329706