Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, OnInit} from '@angular/core';
- import {AppService} from '../../_app/app.service';
- import {App, User} from '../../../api';
- import {Observable, Observer} from 'rxjs';
- import {AuthService} from '../../_auth/auth.service';
- import {Input} from '@angular/core';
- import {tap} from 'rxjs/internal/operators';
- @Component({
- selector: 'app-header',
- templateUrl: './header.component.html',
- styleUrls: ['./header.component.scss'],
- })
- export class HeaderComponent implements OnInit {
- public user$: User;
- constructor(public authService: AuthService, public appService: AppService) {
- this.user$ = this.authService.currentUser.pipe(tap(user => this.user$ = user));
- }
- ngOnInit() {
- alert(this.user$.firstName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement