我有一个angular2项目,其中index.html包含标题栏.其他组件将负责登录和显示其他内容.
我必须在标题栏中显示一个标识,仅当用户登录时才会出现在index.html中.如果用户登录,我在app.component.ts中设置一个标志.如何在index.html中引用该标志?
Loading...
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
static loggedIn = false;
getLoggedIn() {
return AppComponent.loggedIn;
}
}