Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chandra329706 opened this issue Aug 9, 2017 · 0 comments

Comments

@chandra329706
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant