angular2-meteor
angular2-meteor copied to clipboard
Sidebar and navbar are not rendering if the page is not refreshed angular2
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