如何隐藏侧面菜单栏同一页面的菜单项。在离子2

时间:2017-09-12 18:34:34

标签: ionic2 angular2-template angular2-directives

在app.component.ts中,我添加了菜单项的所有页面,当主页打开时我想从侧面菜单栏隐藏主菜单项,所有页面都相同。我试图使用类名来隐藏,但它会影响所有菜单项css。请给我解决方案:

 constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
      this.initializeApp();

      this.pages = [
                      { title: 'Home', component: HomePage, icon:'home' },
                      { title: 'Order History', component: OrderHistory, icon:'timer' },
                      { title: 'Profile', component: Profile, icon:'person' }
                    ];
     }

    openPage(page) {
                    console.log("open Menu");
                    // Reset the content nav to have just this page
                    // we wouldn't want the back button to show in this scenario
                    this.nav.setRoot(page.component);   
    }

0 个答案:

没有答案