作为标题,我想在某个子视图中使用多个控制器
routes.js(例如):
.state("multi",{
url: "/multi",
views: {
"": {
templateUrl: "multipleView.htm",
controller: "MainCTRL",
controllerAs: "ctrl"
},
"viewA@multi": {
templateUrl: "testingBlock.htm",
controller: ["CtrlOne", "CtrlTwo"],
controllerAs: "ctrl"
},
});
或者我应该将 CtrlOne 和 CtrlTwo 放在第三个控制器中:
function CtrlThree($scope){
CtrlOne($scope);
CtrlOTwo($scope);
}