I’m starting to switch my app to Ionic Framework. Great work so far guys!
I’m having an issue with multiple states with tabs and views. I don’t know much about moving this to codepen or I would do that, but here is the ZIP of my project. It’s a modified version of the ionic start side menu project.
Link to ZIP
If you have node, you can run the included minimized web browser via command line, easily enough.
How to reproduce:
- Start page Welcome
- Click button “Logged In Checked In”
- Click right menu open
- Click Tabs
- Click through tabs
- Open right menu
- Click Tabs2
- Even though URL is Tabs2, Tabs is being displayed
Forgot to include another little bug:
When clicking through the tabs, the title in the nav bar isn’t changing each time. It’s random on when the title gets updated.
Anyone able to download and give my project a quick run? Is it something in Ionic or my route configuration that is messing with the multiple tab states? Thanks.
check this codepan and compere it to yours.
This example isn’t really comparable to mine. I’m using side menu + tab + tab2, where this is just 1 tab with multiple states.
When I have 1 tab state, everything works fine it seems, when I added the 2nd tab state, is when there’s an issue.
please provide a codepan with your code .
I’ve forked it and modified to be like mine:
See the Pen Tabs And Navigation: Nightly by Scott Nelson (@ScottN) on CodePen.
it a problem with the 3rd nested views with @ ,
as i now you have to choices,
rewrite you state code the each tab gets a new state like you sew in my codepan.
set the ionic config max cache to 0 like
Thanks for your reply.
I’ve modified the codepen to use individual states for the tab pages, the app runs but now there are no content on any tab pages and still the problem exists that when navigating to the 2nd tab page, it’s rendering the 1st tab page instead and links only work for the 1st.
Can you see an issue still with my code or is it an Ionic issue?
So the issue is how you your states defined.
Notice how tab1 and tab2 are setup as abstract states and I also update the names of the home,about, and settings states.
So How you had it before was actually the correct out put for what your code was like.
Since the view that setup each ion-tabs only had nav-views, it didnt really have any content to display, which is why it was blank.
I’m having another little quirk. Is it ok if I continue on this thread for others to follow in the future?
I’ve forked the codepen you did and modified it. Take a look at the link below.
- I’ve added a “Details” state
- I’ve created a button on Welcome page that navigates to this state
- When you click it, it navigates fine and introduces a “back” button to Welcome on the top
- Click Tabs and then click “Details”
- The navigation to “Details” happens but no “back” button is at top
Any ideas? Here is codepen:
See the Pen Multi-Tabs And Side-Menu: Nightly by Scott Nelson (@ScottN) on CodePen.
I had a similar problem and it took me a while to figure it out so sharing in case it happens to someone else.
I defined by mistake the
abstract: true parameter inside the menuContent, meaning:
Instead of (correct below):
The wrong code was actually working fine with one set of tabs only, but not when there are multiple menus with tabs (like in this example), only the first set of tabs opened would display.