我是新來的角度,我想知道,如果angularjs支持嵌套的路線就像emberjs我的意思是這樣的路線:myappurl/#/company/:company_id/department/:department_id
如何讓Angularjs嵌套路線?
7
A
回答
3
根據該文件中給出的例子:https://docs.angularjs.org/api/ngRoute/directive/ngView。是的,Angularjs支持它。
3
7
它值得一提的還有,除了ui-router
另一個角度庫來完成這個任務。這其中也工作:
http://angular-route-segment.com
這是很簡單的UI相比,路由器使用。樣本路由配置是這樣的:
$routeSegmentProvider.
when('/section1', 's1.home').
when('/section1/prefs', 's1.prefs').
when('/section1/:id', 's1.itemInfo.overview').
when('/section1/:id/edit', 's1.itemInfo.edit').
when('/section2', 's2').
segment('s1', {
templateUrl: 'templates/section1.html',
controller: MainCtrl}).
within().
segment('home', {
templateUrl: 'templates/section1/home.html'}).
segment('itemInfo', {
templateUrl: 'templates/section1/item.html',
controller: Section1ItemCtrl,
dependencies: ['id']}).
within().
segment('overview', {
templateUrl: 'templates/section1/item/overview.html'}).
segment('edit', {
templateUrl: 'templates/section1/item/edit.html'}).
up().
segment('prefs', {
templateUrl: 'templates/section1/prefs.html'}).
up().
segment('s2', {
templateUrl: 'templates/section2.html',
controller: MainCtrl});
相關問題
- 1. 如何在angularjs嵌套子路線2
- 2. 嵌套路線
- 3. 嵌套路線| Rails4
- 4. Rails嵌套路線
- 5. 嵌套API路線
- 6. Cakephp嵌套路線
- 7. 嵌套路線3
- 8. 基本嵌套路線(如何嵌套的路線,而不是同時嵌套路由)
- 9. 嵌套路線路由器
- 10. 嵌套路線和無路線匹配
- 11. Ember路線嵌套結構
- 12. 三級嵌套路線
- 13. 負載嵌套路線
- 14. 上破嵌套路線
- 15. 帶嵌套路線的pg_search
- 16. 短嵌套軌道路線
- 17. Link_to幫手:嵌套路線
- 18. 嵌套路線,傳遞:USER_ID
- 19. 嵌套路線行不通
- 20. 規範嵌套路線
- 21. 非嵌套燼路線
- 22. 自定義嵌套路線
- 23. 命名嵌套的路線
- 24. will_paginate和嵌套的路線
- 25. 創建嵌套路線
- 26. 嵌套路線與:成員
- 27. 暴露的嵌套路線
- 28. 角:多重嵌套路線
- 29. angularjs如何嵌套ng-repeat
- 30. RoR |如何讓content_tags嵌套?
非常感謝你在我的團隊的前端開發者很高興:)我們錯過了。 –