import { Component , OnInit } from '@angular/core' ; import { BreakpointObserver , Breakpoints , BreakpointState } from '@angular/cdk/layout' ; import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; import { DataService } from '../data/data.service' ; @ Component ( { selector : 'ff-nav' , templateUrl : './nav.component.html' , styleUrls : [ './nav.component.scss' ] } ) export class NavComponent implements OnInit { isHandset$ : Observable < boolean > = this . breakpointObserver . observe ( Breakpoints . Handset ) . pipe ( map ( result => result . matches ) ) ; constructor ( private breakpointObserver , private data ) { } ngOnInit ( ) { } get user ( ) : any { return this . data . user ; } }