Tabs / Angular Ui router - Link on the same page in different views


#1

I use Ionic for with tabs .

In each view, I have a link that redirects to the same page and that needs to use for the current tab.

My tab

<ion-tabs class="tabs-icon-top tabs-positive">

     <ion-tab title="Carte" icon="ion-map" href="#/app/expos/map">
         <ion-nav-view name="expos-map-tab"></ion-nav-view>
     </ion-tab>

     <ion-tab title="Expositions" icon="ion-ios-list-outline" href="#/app/expos/list">
         <ion-nav-view name="expos-list-tab"></ion-nav-view>
     </ion-tab>

     <ion-tab title="Favoris" icon="ion-heart" href="#/app/expos/favoris">
         <ion-nav-view name="expos-favoris-tab"></ion-nav-view>
     </ion-tab>

</ion-tabs>

My app.js

  .state('app.expos', {
        url: '/expos',
        abstract: true,
        views: {
             'menuContent': {
                 controller: 'exposCtrl',
                 templateUrl: 'templates/expos_tabs.html'
             }
         }
     }) 
.state('app.expos.map', {
    url: '/map',
    views: {
        'expos-map-tab': {
            controller: 'exposMapCtrl',
            templateUrl: 'templates/expos_map.html'
        }
    }
})

.state('app.expos.list', {
    url: '/list',
    views: {
        'expos-list-tab': {
            controller: 'exposListCtrl',
            templateUrl: 'templates/expos_list.html'
        }
    }
})

.state('app.expos.favoris', {
    url: '/favoris',
    views: {
        'expos-favoris-tab': {
            controller: 'exposFavorisCtrl',
            templateUrl: 'templates/expos_favoris.html'
        }
    }
})

.state('app.expos.exposant', {
    url: '/exposant/:id',
    controller: 'ExposantCtrl',
    views: {
        'expos-map-tab': {
            templateUrl: 'templates/expos_page_exposant.html'
        },
        'expos-favoris-tab': {
            templateUrl: 'templates/expos_page_exposant.html'
        },
        'expos-list-tab': {
            templateUrl: 'templates/expos_page_exposant.html'
        }
    }
})

expos_list.html

<ion-view view-title="Expos">
    <ion-content>
        <ion-list>
            <ion-item ng-repeat="exposition in expositions" ui-sref="app.expos.exposant({id:exposition.ID})">
                <h2>{{exposition.title}}</h2>
            </ion-item>
        </ion-list>
    </ion-content>
</ion-view>

In the expo_lists.htmtl, i have a link on “app.expos.exposant” that will not appear in the right order… It would have to be displayed in the “expos-favoris-list” view.

I have the same link in my other templates…

Thanks for help