當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MatSidenav.toggle方法代碼示例

本文整理匯總了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);
                }
            });
    }
開發者ID:,項目名稱:,代碼行數:42,代碼來源:

示例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);
     }
 });
開發者ID:,項目名稱:,代碼行數:14,代碼來源:

示例3: toggleSideNav

 /**
  * Toggles the side nav
  */
 public toggleSideNav(): void {
     this.sideNav.toggle();
 }
開發者ID:jwinzer,項目名稱:OpenSlides,代碼行數:6,代碼來源:site.component.ts

示例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;
 }
開發者ID:idealhack,項目名稱:gocryptotrader,代碼行數:11,代碼來源:sidebar.service.ts

示例5: serviceToggle

 public serviceToggle() {
   console.log("Dans le sidenavService: " + this.sidenav);
   return this.sidenav.toggle();
 }
開發者ID:Dardym,項目名稱:RepriseOrdi,代碼行數:4,代碼來源:sidenav.service.ts

示例6: toggle

 public toggle(): void {
   this.sidenav.toggle();
 }
開發者ID:adolfolopez88,項目名稱:Store,代碼行數:3,代碼來源:sidenav.service.ts


注:本文中的@angular/material.MatSidenav.toggle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。