NK
Size: a a a
NK
SФ
SФ
SФ
AK
AK
AK
NK
SФ
NK
NK
NK
SФ
O
SФ
O
SФ
let status = new new BehaviorSubject<boolean>(false);
status.asObservable().subscribe(s=>console.log(s))
angular2 observable store
O
// service
private status = new BehaviorSubject<boolean>(false)
setLogin(value: boolean) {
this.status = new BehaviorSubject(value)
}
getLogin() {
return this.status.asObservable()
}
// login comp.
this.AuthService.setLogin(this.isLogin)
// header com.
this.AuthService.getLogin().subscribe(result => console.log(result))