import { Component , OnDestroy } from '@angular/core' ; import { NbThemeService , NbMediaBreakpoint , NbMediaBreakpointsService } from '@nebular/theme' ; @ Component ( { selector : 'ngx-typography' , styleUrls : [ './typography.component.scss' ] , templateUrl : './typography.component.html' , } ) export class TypographyComponent implements OnDestroy { breakpoint : NbMediaBreakpoint ; breakpoints : any ; themeSubscription : any ; constructor ( private themeService , private breakpointService ) { this . breakpoints = this . breakpointService . getBreakpointsMap ( ) ; this . themeSubscription = this . themeService . onMediaQueryChange ( ) . subscribe ( ( [ oldValue , newValue ] ) => { this . breakpoint = newValue ; } ) ; } ngOnDestroy ( ) { this . themeSubscription . unsubscribe ( ) ; } }