constructor(private mqm: BreakpointObserver) { this.isHandset = this.mqm.observe([Breakpoints.HandsetLandscape, Breakpoints.HandsetPortrait]); this.isTablet = this.mqm.observe(Breakpoints.Tablet); this.isWeb = this.mqm.observe([Breakpoints.WebLandscape, Breakpoints.WebPortrait]); this.isPortrait = this.mqm.observe('(orientation: portrait)'); this.isLandscape = this.mqm.observe('(orientation: landscape)'); }
ngOnInit() { this.breakpointObserver .observe([Breakpoints.XSmall, Breakpoints.Small]) .subscribe((state: BreakpointState) => { this.isScreenSmall = state.matches ? true : false; }); }
constructor(public media: BreakpointObserver, iconRegistry: MatIconRegistry, sanitizer: DomSanitizer, cdr: ChangeDetectorRef) { iconRegistry.addSvgIconSet(sanitizer.bypassSecurityTrustResourceUrl('./../../../assets/mdi.svg')); media.observe('(max-width: 599px)').subscribe( isMatched => { this.isMediaSmall = isMatched.matches; cdr.markForCheck(); }); }