本文整理汇总了TypeScript中@angular/flex-layout.ObservableMedia.isActive方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ObservableMedia.isActive方法的具体用法?TypeScript ObservableMedia.isActive怎么用?TypeScript ObservableMedia.isActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/flex-layout.ObservableMedia
的用法示例。
在下文中一共展示了ObservableMedia.isActive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ngOnInit
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void
{
// Register the sidenav to the service
this._fuseMatSidenavHelperService.setSidenav(this.fuseMatSidenavHelper, this._matSidenav);
if ( this._observableMedia.isActive(this.matIsLockedOpen) )
{
this.isLockedOpen = true;
this._matSidenav.mode = 'side';
this._matSidenav.toggle(true);
}
else
{
this.isLockedOpen = false;
this._matSidenav.mode = 'over';
this._matSidenav.toggle(false);
}
this._fuseMatchMediaService.onMediaChange
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => {
if ( this._observableMedia.isActive(this.matIsLockedOpen) )
{
this.isLockedOpen = true;
this._matSidenav.mode = 'side';
this._matSidenav.toggle(true);
}
else
{
this.isLockedOpen = false;
this._matSidenav.mode = 'over';
this._matSidenav.toggle(false);
}
});
}
示例2: ngOnInit
public ngOnInit() {
this.enableSideNav$ = this.media.asObservable()
.map(() =>
this.media.isActive('xs') || this.media.isActive('sm')
)
.startWith(this.media.isActive('xs') || this.media.isActive('sm'));
}
示例3: ngOnInit
ngOnInit() {
// auto adjust side nav only if not embed
this.isNarrowView = /*this.headerEnabled &&*/ (this.media.isActive('xs') || this.media.isActive('sm'));
this.media.subscribe((change: MediaChange) => {
this.isNarrowView = /*this.headerEnabled &&*/ (change.mqAlias === 'xs' || change.mqAlias === 'sm');
});
}
示例4:
.subscribe(() => {
if ( this._observableMedia.isActive(this.matIsLockedOpen) )
{
this.isLockedOpen = true;
this._matSidenav.mode = 'side';
this._matSidenav.toggle(true);
}
else
{
this.isLockedOpen = false;
this._matSidenav.mode = 'over';
this._matSidenav.toggle(false);
}
});
示例5:
.map(() =>
this.media.isActive('xs') || this.media.isActive('sm')
示例6:
grid.forEach((cols, mqAlias) => {
if (this.observableMedia.isActive(mqAlias)) {
start = cols;
}
});