我是棱角分明的新手,我尝试让子菜单工作。在每个Controller中,我使用$ rootScope来应用视图的实际子菜单。显示菜单,但它不会更新视图更改:
DashboardController:
controller('DashboardCtrl', function DashboardCtrl ( $scope , $rootScope, restService, $location, $routeParams) {
$rootScope.submenu = [{
name: "link1",
link: "/#/link1"
},{
name: "link2",
link: "/#/link2"
}];
});
ArticleController:
controller('ArticleCtrl', function ArticleCtrl ( $scope , $rootScope, restService, $location, $routeParams) {
$rootScope.submenu = [{
name: "link1",
link: "/#/link1"
},{
name: "link2",
link: "/#/link2"
}];
});
我想我错过了什么。有人能告诉我一个有效的解决方案吗?
由于