First off, Ionic is an awesome framework, we love how it’s cleanly designed and architected with performance in mind.
One thing though, my team and I are almost done with our app except for some annoyances. We have a nav-router wrapping our , all pages in our app live in separate templates wrapping their content in a <nav-page> element.
Now one of these templates must implement a Tab Bar with two tabs, the tab bar must also have its own header with a right button which triggers a right slide menu, and a left button to take us back to the main controller.
It’s been weeks that we aren’t able to wrap our heads around implementing this page in Ionic! A nasty trick we tried out is to hide the nav-router header with a navController.hide immediately when initializing our tabs page controller, showing a manual <header> element wrapped in an automatic <sideBars> with only a right menu defined. This however doesn’t look good at all and raises TypeError: ‘null’ is not an object (evaluating ‘this.el.style’) when sliding the menu.
Hey Nick. If I understand correctly, you want a “page” of the nav controller to show your tabbed interface, and then not have any navigation inside of it?
It should be possible. I’m going to block some time off tomorrow to see about this, as well as the case where we want to have a tabbed interface where the navigation happens inside one of the tab content areas.
If you had an example of what you are trying to do, that could help! Thanks.
Yes this is what we want to achieve with one addition, being a side right menu triggered by a header button (or swipe in header area), within any of the tab pages.
Hey Nick. Using tabs like this isn’t quite working yet. We are doing a big overhaul of the nav system to make it much better, and Adam is starting work on that today. I’ll look into the header things…
I managed to achieve my goal with a simple trick. Apparently, the reason why I’m losing my right buttons is because my tabs simply reinitialize the header whenever I switch between them.
For this reason I had to set $scope.rightButton in my tab controllers instead of <nav-page>. To centralize my logic, I had to move my actual right button logic implementation to the parent controller, then on $scope.$on('tab.shown') hook I would set $scope.rightButtons = $scope.$parent.rightButtons; and this seems to do the job.
The community behind Ionic Framework has great stamina and dedication. In couple of weeks from now we’re taking live a handful of mobile apps powered by Ionic.
Hi credli
Thanks for you persistence in trying to get side menus with tab pages working. Looks like you are nearly there.
Any chance you could post up a sample project that help us others try to catch up. Enjoying Ionic but feel a little behind the pack at the moment.
Could I ask if you side menus with pages including tabs are also working on Android (v4.x)
Here is the sample Plunker snippet, albeit with some hacks and a nasty repeated rightButton logic.
I believe @max and Adam are working on an overhaul, until then I have decided to follow the “whatever works” principle
Also, my snippet seems to work fine on Android 4.1 and 4.2, I don’t know if it works on 4.3 and 4.4 though. I’ve read somewhere that starting 4.4 Android WebViews are chromium-powered, this could be promising since I can run Ionic apps on my Chrome browser without any issue.