Angular ui-route重载电流控制器

时间:2015-12-12 11:35:15

标签: javascript angularjs

我遇到了重装当前状态的问题。

我可以重新加载当前状态只重新加载内容吗?

%Participants ID
participantID(1).
participantID(2).
participantID(3).
participantID(4).
participantID(5).
participantID(6).
participantID(7).
participantID(8).
participantID(9).
participantID(10).
participantID(11).
participantID(12).

%Meeting(name, duration, obligatory participants, optional participants)
meeting(thesis_presentation,1,[12,3,5],[1]).
meeting(company_meeting,1,[10,3],[5]).
meeting(chairman_election,3,[1,2,3],[4,5,6]).

%Placement(meeting, type)
place(meeting(thesis_presentation), auditorium).
place(meeting(company_meeting), normal).
place(meeting(chairman_election), auditorium).

%Rooms(id, type, capacidade) -> Regular=normal, Auditorium=projector, Conference Room=videoconference
room(1,normal, 5).
room(2,normal, 5).
room(3,normal, 5).
room(4,conference_room, 10).
room(5,conference_room, 10).
room(6,auditorium, 15).

如果我在类别网站上,请致电

.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise('/app/dashboard');
    .state('app', {
            abstract: true,
            url: '/app',
            views: {
                '': {
                    templateUrl: '/app/content.html'
                },
                'sidebar': {
                    templateUrl: '/app/sidebar.html'
                },
            },
        })
     .state('app.categories', {
        url: '/categories',
        templateUrl: '/app/category/category.html',
        resolve: {
            loadJs: ['$ocLazyLoad', function ($ocLazyLoad) {
                return $ocLazyLoad.load('/app/category/category.app.js');
            }]
        }
    })

我只想要主要部分(见图)。

picture

现在它重新加载整个州。如果它重新加载整个状态我的所有导航(左侧)中断的问题。

我当前的HTML:

$state.transitionTo($state.current, {}, {reload: true});

我该怎么做?

1 个答案:

答案 0 :(得分:0)

我找到了答案。

$state.transitionTo($state.current, {}, {reload: 'app.categories'});
相关问题