Assign multiple controller in $stateProvider.state

后端 未结 2 2106
别跟我提以往
别跟我提以往 2021-02-07 15:20

Probably this is an easy question for advanced angular users, but I did not find this issue somewhere well explained.

So I was restructuring my code, when I realized, I

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 16:21

    Split your layout and use something like:

    .state('app.somestate', {
                url : '/someurl',
                views:{
                    'menuContent': {
                        templateUrl: 'part1.html',
                        controller: 'ACtrl'
                    },
                    'otherContent': {
                        templateUrl: 'part2.html',
                        controller: 'BCtrl'
                    },
                    'someotherContent': {
                        templateUrl: 'part3.html',
                        controller: 'CCtrl'
                    }
                }
            })
    

提交回复
热议问题