I am learning Angular2 and I get a problem right now. In my page, I have a "Log in" button. After user logged in, I want to change it to "Log out". Since this button is in app.component, it gets loaded only once. Thanks in advance.
My app.component.html
<a *ngIf="signedIn==true" [routerLink]="['Logout']">Log out</a>
<a *ngIf="signedIn==false" [routerLink]="['Login']">Log in</a>
App.component.ts
export class AppComponent {
constructor(private _loginService: LoginService) {}
signedIn: boolean = this._loginService.isSignedIn();
}