Desabled Menu


#1

I have a Menu, but I want desabled in LoginPage before the HomePage

export class MyApp {
  @ViewChild(Nav) nav: Nav;

  rootPage: any;
  loader: any;

  pages: Array<{title: string, component: any}>;

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

    // used for an example of ngFor and navigation
    this.pages = [
      { title: 'Causas', component: HomePage },
      { title: 'Meu perfil', component: ProfileClient },
      { title: 'Cadastrar Ocorrência', component: CreateOccurrence },
      { title: 'Ver Causas', component: CatchCauses },
      { title: 'Advogados', component: ListLawyers },
      { title: 'Acadêmico', component: Academic },
      { title: 'Sair', component: null },
    ];

    this.login();
  }


openPage(page) {
    if(page.component){
      this.nav.setRoot(page.component);
    }
    else {
      this.service.destroyUserCredentials();
    }
    // return this.nav.setRoot(Begin);
  }

How desable Menu in LoginPage ?


#2

Are you setting rootPage to LoginPage?


#3

Well, I see in a tutorial there are a method bellow of construct look


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

    // used for an example of ngFor and navigation
    this.pages = [
      { title: 'Causas', component: HomePage },
      { title: 'Meu perfil', component: ProfileClient },
      { title: 'Cadastrar Ocorrência', component: CreateOccurrence },
      { title: 'Ver Causas', component: CatchCauses },
      { title: 'Advogados', component: ListLawyers },
      { title: 'Acadêmico', component: Academic },
      { title: 'Sair', component: null },
    ];

    this.login();
  }

  login() {
    this.presentLoading();
    this.service.login().then((isLoggedIn) => {
      if(isLoggedIn){
        console.log('Logged!');
        this.rootPage = HomePage;
      }else{
        this.rootPage = Begin;
        console.log('Not Logged!');
      }
      this.loader.dismiss();
    });
  }

In my project I have a BeginPage before LoginPage, but its the same things


#4

It’s not the same thing. Would you mind answering the question?


#5

ok, then LoginPage ok, I want desabled Menu in LoginPage ???