Permalink
Switch branches/tags
Nothing to show
Find file Copy path
865fec3 May 31, 2018
1 contributor

Users who have contributed to this file

37 lines (30 sloc) 820 Bytes
import { Component, OnInit } from '@angular/core';
import { ObservableMedia, MediaChange } from '@angular/flex-layout';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-menu',
templateUrl: './menu.component.html',
styleUrls: ['./menu.component.css']
})
export class MenuComponent implements OnInit {
opened = true;
over = 'side';
expandHeight = '42px';
collapseHeight = '42px';
displayMode = 'flat';
// overlap = false;
watcher: Subscription;
constructor(media: ObservableMedia) {
this.watcher = media.subscribe((change: MediaChange) => {
if (change.mqAlias === 'sm' || change.mqAlias === 'xs') {
this.opened = false;
this.over = 'over';
} else {
this.opened = true;
this.over = 'side';
}
});
}
ngOnInit() {
}
}