Guest User

Untitled

a guest
Aug 10th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## AuthService
  2.   public currentUser: Observable<ApplicationUser>;
  3.   public userCurrent: ApplicationUser;
  4.  
  5.   getCurrentUserInfo(): Observable<ApplicationUser> {
  6.     this.currentUser = this.http.get<ApplicationUser>(this._userInfoUrl);
  7.     return this.currentUser;
  8.   }
  9.  
  10. ## AppComponent
  11.   currentUser: ApplicationUser;
  12.   ngOnInit() {
  13.     this.authService.getCurrentUserInfo().subscribe(data => {
  14.       this.currentUser = this.authService.userCurrent;
  15.     });
  16.   }
  17.  
  18. ## Widok
  19.  
  20. <a>{{(currentUser)?.Email}}</a>
Advertisement
Add Comment
Please, Sign In to add comment