Ionic tabs: how to reuse the same detail page on different tabs

Here are two posts that basically describe the same need as mine. Unfortunately, they were left without a concrete solution.

http://forum.ionicframework.com/t/reuse-master-detail-page-template-between-tabs/17493

http://forum.ionicframework.com/t/same-detail-page-for-2-different-tabs-with-history/17425

To explain a little better what we are trying to achieve, see the diagrams below.

I believe Diagram 1 needs no explanation , as this is a classic use of the tab user interface component.

enter image description here

, 2, , , , - / ui-router.

enter image description here

, . () , , , . , !

, , , ?

: , .

, ui-router " " , "profile-into":

.state('profile.intro', {
            url: '/intro/:username',
            views: {
                **'profile-intro'**: {
                    templateUrl: 'app/profile/views/profile-intro.html',
                    controller: 'ProfileIntroCtrl'
                }
            }
        })

, .

, - , ...

!

+4
1

Ionic, , ...

, . $ionicTabsDelegate , , - $scope.selectedTabIndex = $ionicTabsDelegate.selectedIndex();

. , , URL. selectedTabIndex, , .

, , , :

ng-click="viewUser(id, selectedTabIndex);"

- :

$scope.viewUser = function(uid, tabIndex){
    if(tabIndex == 2){
        $state.go('tab.me-user',{ uid: uid});
    } else {
        $state.go('tab.user-profile',{ uid: uid});
    }
};

, , . , - .

+1

Source: https://habr.com/ru/post/1616709/