从(Plnkr):
移动时中断.state('home', {url: '/home', template: '<pre>{{parentProp}}</pre>',
controller: function ($scope) {$scope.parentProp = ['home'];}})
(Plnkr):
.state('home', {url: '/home', views: {'': {template: '<pre>{{parentProp}}</pre>'}},
controller: function ($scope) {$scope.parentProp = ['home'];}})`
具体来说,我有一个'sidebar'
状态,我想把它作为'home'
的辅助状态。
视图需要自己的控制器:
.state('home', {url: '/home',
views: {'': {template: '<pre>{{parentProp}}</pre>',
controller: function ($scope) {
$scope.parentProp = ['home'];
}
}
},
})`
http://plnkr.co/edit/giW3XRspEV7SEPM1UDeC?p =预览