0
我是Angular的n00b,並試圖讓我的頭瞭解ui路由如何工作。我看到了多條路線的概念如何工作,以及嵌套路線如何工作。我會怎麼做?或者這是不是很好的做法?更新單個視圖,其中有很多AngularJs和UI-路由器
在這個例子中波紋管我應用程序/ WH工作正常,但是當一些去我只想要中間視圖交換應用程序/ WH/TOC/123。
.state('app.wh', {
url: "/wh",
views: {
'left' : {
templateUrl: "static/partials/leftPane.html"
},
'middle': {
templateUrl: "static/partials/start.html"
},
'right' : {
templateUrl: "static/partials/rightPane.html",
controller: 'AsideCtrl'
}
}
})
.state('app.wh.toc', {
url: "/toc/:id",
views: {
'middle' : {
templateUrl: "static/partials/toc.html",
controller: function($scope, $stateParams, $state){
$scope.title = $stateParams.id;
}
}
}
})
我覺得這是我錯過了什麼。我不覺得我正在做的是正確的做法。現在就給它一個鏡頭,謝謝 – abritez
感謝ng-include實際上也回答了我的其他一些問題。在ui路由器上過於依賴 – abritez