本文整理汇总了TypeScript中@angular/material.MatSidenav.toggle方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MatSidenav.toggle方法的具体用法?TypeScript MatSidenav.toggle怎么用?TypeScript MatSidenav.toggle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/material.MatSidenav
的用法示例。
在下文中一共展示了MatSidenav.toggle方法的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:
.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);
}
});
示例3: toggleSideNav
/**
* Toggles the side nav
*/
public toggleSideNav(): void {
this.sideNav.toggle();
}
示例4: toggle
/**
* Toggle this sidenav. This is equivalent to calling open() when it's already opened, or close() when it's closed.
*
* @param {boolean} isOpen Whether the sidenav should be open.
*
* @returns {Promise<MatSidnavToggleResult>}
*/
public toggle(isOpen?: boolean): Promise<MatDrawerToggleResult> {
this.sidenav.toggle(isOpen);
return;
}
示例5: serviceToggle
public serviceToggle() {
console.log("Dans le sidenavService: " + this.sidenav);
return this.sidenav.toggle();
}
示例6: toggle
public toggle(): void {
this.sidenav.toggle();
}