$ rootScope中的菜单结构不会更新视图

时间:2013-11-03 09:34:48

标签: angularjs

我是棱角分明的新手,我尝试让子菜单工作。在每个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"
    }];
});

我想我错过了什么。有人能告诉我一个有效的解决方案吗?

由于

0 个答案:

没有答案