How to reuse one page in tab bar project?


#1

I started a project with tab bar. I want tab A page and tab B page navigate to child c page.

.state('tab.a', {
                url: '/a',
                views: {
                    'tab-a': {
                        templateUrl: 'templates/tab-a.html',
                        controller: 'ACtrl'
                    }
                }
            })

        .state('tab.b', {
            url: '/b',
            views: {
                'tab-b': {
                    templateUrl: 'templates/tab-b.html',
                    controller: 'BCtrl'
                }
            }
        })

.state('c', {
                url: '/c',
                views: {
                    'xxxx': {
                        templateUrl: 'templates/c.html',
                        controller: 'CCtrl'
                    }
                }
            })

the xxxx position above code, even tab-a or tab-b all are not what i want.
How to make page c look like tab a or tab b owned child page?


#2

Have you tried to define 2 states using same template C? You’d have also to dup the controller.


#3

good job. appreciate~ :grinning: