我是新来的角度,我想知道,如果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嵌套?
非常感谢你在我的团队的前端开发者很高兴:)我们错过了。 –