I am building my own app by learning from the ionic conference app"
I am trying like this:
constructor() {
this.menu.enable(true, ‘loggedInMenu’);
console.log(this.menu)
}
But the menu with id “loggedInMenu” isn’t enabled. Sorry that I can’t paste my complete code here. Maybe someone happen to know why it doesn’t work
My app flow is like this:
app start---->landing page(split page disabled)---->home page(split page enabled again).
I did the same like this on app.component.ts:
` // decide which menu items should be hidden by current login status stored in local storage`
` this.userData.hasLoggedIn().then((hasLoggedIn) => {`
` this.enableMenu(hasLoggedIn === true);`
` });`
`this.enableMenu(true);`
But it didn’t work. So I tried to troubleshoot like this:
first, like I said in your other previous post, I would really appreciate if you could format your code, it’s not easy to read like this, sorry to be a bit picky about that
then two things:
could you show the code of your loggedInMenu in your app.component.html?
have you try maybe to add the code in the init block instead of in the constructor?
no worries, it’s just that only the code most of the answer are only guess, but some users of the forum hopefully are better than me to answer questions