Angular2 ChangeDetection or Observable?

前端 未结 2 705
轮回少年
轮回少年 2021-01-06 02:27

I\'m having difficulty with a component that doesn\'t refresh upon log in.

The component is navbar.component that contains links to my pages/components. On it, there

2条回答
  •  情深已故
    2021-01-06 03:15

    export class UserService {
      isLoggedIn:BehaviorSubject = new BehaviorSubject(false);
    }
    
    @Component({
    ...
    template: `
    Login
    Logout
    `
    
    })
    export class MyComponent {
      constructor(private userService: UserService) {}
    }
    

提交回复
热议问题