0

I am developing my first Ionic-App which has 4 tabs(home,category,chat,profile) + Camera button in the middle.

So now my question is: How can I use one route, as Example tabs_footer.userProfileFeed, which I can call from every tab/view like this:

ui-sref="tabs_footer.userProfileFeed"

and my thought was to define the state like this:

.state('tabs_footer.userprofileFeed', {
    url: '/userprofileFeed/:imageID',
    views: {
      'profile-tab' : {
        templateUrl: 'templates/userprofile/userprofile_gallery_detail.html'
      },
      'category-tab' : {
        templateUrl: 'templates/userprofile/userprofile_gallery_detail.html'
      },
      'notifications-tab' : {
        templateUrl: 'templates/userprofile/userprofile_gallery_detail.html'
      },
      'homeGallery-tab' : {
        templateUrl: 'templates/userprofile/userprofile_gallery_detail.html'
      }
    }
})

Tabs_Footer-code:

 <script id="tabs_footer.html" type="text/ng-template">
          <ion-tabs id="footer-nav"class="tabs-positive tabs-striped">
            <ion-tab icon="ion-ios-home-outline" ui-sref='tabs_footer.homeGallery'>
              <ion-nav-view name="homeGallery-tab"></ion-nav-view>
            </ion-tab>
            <ion-tab icon="ion-compass" ui-sref='tabs_footer.category'>
              <ion-nav-view name='category-tab'></ion-nav-view>
            </ion-tab>
            <ion-tab ng-controller='CameraCtrl' icon="ion-ios-camera-outline" ng-click='getPhoto()'>
              <ion-nav-view name="camera-tab"></ion-nav-view>
            </ion-tab>
            <ion-tab icon="ion-ios-chatboxes-outline" ui-sref='tabs_footer.directChat'>
              <ion-nav-view name="notifications-tab"></ion-nav-view>
            </ion-tab>
            <ion-tab icon="ion-ios-person-outline" ui-sref='tabs_footer.ownprofile'>
              <ion-nav-view name="profile-tab"></ion-nav-view>
            </ion-tab>
          </ion-tabs>
        </script>

and here the state of tabs_footer:

.state('tabs_footer', {
    url: '/tabsFooter',
    abstract: true,
    templateUrl: 'tabs_footer.html'
})

but it seems them I am using this wrong. How can this be solved right?

So in Conclusion:

I want one state for all views which I want to call over ui-sref="tabs_footer.userProfileFeed"

Please help me! :)

Sincerly,

Bernhard

Bernhard Miehl
  • 346
  • 1
  • 5
  • 15

0 Answers0