Problems adding side menu to project already started

0

I'm starting with Ionic , I have a question.

I created a blank ionic start project blank project, and I was able to create the main screen of my application, just a LOGO with "ENTER" button to enter the app, but I would add in the page ENTER, a side menu. But I have been researching for some time but I can not find it, I believe it is possible.

I would just like to have SideMenu on the main screen, but it is not the screen that starts the app, so I could not create it with the sidemenu model. Is it possible to add a SIDEMENU to a project already created in blank?

I'm really looking for but without success.

    
asked by anonymous 15.06.2018 / 16:07

1 answer

1

Good Felipe, you can do it in two ways:

1a - Create the app with sidemenu template and change the main page:

  • Create the app with sidemenu template
  • Generates a new page with ionic generate page nome_da_pagina
  • Go to file app.component.ts and set the rootPage property to this new page created (by the time you open the file it should be like MenuPage or something).

When you test you will see that the first page that will be opened is this new created, then just put a click event on the button and the method use NavController to push the new view (which will be MenuPage and will have the menu created by Ionic). Take a look at the documentation of that case.

2a - Continue the form and generate a page that will be the menu.

  • In this case, generate a new page that will serve as a menu.
  • Follow the documentation instructions to make the menu by default.
  • Place a click event on the "Enter" button that will change the rootPage to the menu page.

As you are at the beginning, I recommend following the first way.

    
15.06.2018 / 16:28