支持路由的 AngularJS UI Bootstrap 选项卡 [英] AngularJS UI Bootstrap Tabs that support routing
问题描述
我想在我的项目中使用 AngularJS UI Bootstrap Tabs,但我需要它来支持路由.
I would like to use AngularJS UI Bootstrap Tabs in my project, but I need it to support routing.
例如:
Tab URL
--------------------
Jobs /jobs
Invoices /invoices
Payments /payments
据我所知,目前的 tabs
和 pane
指令不支持路由.
As far as I can tell from the source code, the current tabs
and pane
directives doesn't support routing.
添加路由的最佳方法是什么?
What would be the best way to add routing?
推荐答案
要添加路由,您通常使用 ng-view 指令.我不确定修改角度 UI 以支持您正在寻找的内容是否足够容易,但是 这里是一个 plunker 粗略地展示了我认为你正在寻找的东西(这不一定是最好的方法 - 希望有人能给你一个更好的解决方案或改进这个)
To add routing you typically use an ng-view directive. I'm not sure it's easy enough to modify angular UI to support what you're looking for, but here's a plunker showing roughly what i think you're looking for (it's not necessarily the best way of doing it - hopefully someone can give you a better solution or improve on this)
这篇关于支持路由的 AngularJS UI Bootstrap 选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!