2015-10-15 61 views
0

我使用的不是Angular.js$ stateProvider在我的項目在UI路由器麪包屑,我想用breacrumbs在我的項目。角JS -

注意:網址.STATE不具有價值。
我想:製作breacrumbs沒有使用從Url

myApp.config(function ($urlRouterProvider, $stateProvider) { 

    $urlRouterProvider.otherwise('/otherwise'); 

    $stateProvider 
    .state('page1', { 
     contoller: 'appController', 
     url: '', 
     templateUrl: 'Page1.html', 
    }) 
    .state('page2', { 
     contoller: 'appController', 
     url: '', 
     templateUrl: 'Page2.html' 
    }) 

    .state('page3', { 
     contoller: 'appController', 
     url: '', 
     templateUrl: 'Page3.html' 
    }) 

    .state("otherwise", { 
     contoller: 'appController', 
     url: "*path", 
     templateUrl: "page1.html", 
    }); 
}); 

我倒是這樣的: enter image description here

回答

0

您可以輕鬆地將其注入控制器訪問狀態對象。爲了得到當前狀態下使用:

$state.current 

後,所有你所要做的模板綁定給你的麪包屑變量。