Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49171

Getting $ionicTabsDelegate To Display Tabs Bar

$
0
0

@angelalukic wrote:

I've also asked about this on StackOverflow and GitHub but I don't seem to be getting much luck.

I've currently got an Ionic App which has both a sidemenu and a tabs bar. I'm trying to get it so the tabs bar will display on sidemenu pages which are not children of the tabs bar. The only page which is a child of both is the dashboard. Currently the tabs bar disappears if I access a side menu page that isn't dashboard.

From browsing the Ionic forums I learned of a method which seems to be on the right tracks but it doesn't seem to be working.

Reference: http://ionicframework.com/docs/api/service/$ionicTabsDelegate/

index.html

<ion-content class="side-menu-left" ng-controller="AppCtrl">
  <ion-list <!--Irrelevant Stuff Here-->>
    <ion-item ui-sref="aboutUs" <!--Irrelevant Stuff Here--> ng-click="showTabs()" menu-close>
      <i class="icon ion-information-circled"></i>About Us</ion-item>

  <!-- More Side Menu Items Here etc. -->

controllers.js

.controller('AppCtrl', function($scope, $ionicTabsDelegate) {

    $scope.showTabs = function() {
        $ionicTabsDelegate.showBar(true);
    };
});

I have also tried $ionicTabsDelegate.$getByHandle('tabsController').showBar(true); but this doesn't work either. I can access the page fine but the tabs bar still does not appear.

Here are some other bits of my code if it helps understanding in any way:

aboutUs.html

<ion-view style="" class=" " id="page10" title="About Us">
    <ion-content class="has-header" padding="true"><!--Content Here--></ion-content>
</ion-view>

routes.js

.config(function($stateProvider, $urlRouterProvider) {
$stateProvider

.state('tabsController', {
    url: '/page1',
    templateUrl: 'templates/tabsController.html',
    abstract:true
  })

.state('tabsController.dashboard', {
    url: '/dashboard',
    views: {
      'tab1': {
        templateUrl: 'templates/dashboard.html',
        controller: 'dashboardCtrl'
      }
    }
  })

// Other controllers for tabs pages here

.state('aboutUs', {
    url: '/aboutUs',
    templateUrl: 'templates/aboutUs.html',
    controller: 'aboutUsCtrl'
  })

// Other controllers for sidemenu pages here

$urlRouterProvider.otherwise('/page1/dashboard')

});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49171

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>