Angular UI 路由器:抽象:true 不会显示页面 [英] Angular UI Router: abstract : true won't display page
问题描述
我正在尝试通过嵌套导航将我的大脑围绕在 Angular UI 路由器上.
I'm trying to wrap my brain around Angular UI Router with nested navigation.
我的应用有多个页面.我已经设置了 StateProvider 并且从页面到页面的基本路由工作.但是,我现在正在尝试在这些页面之一中实现选项卡式视图.我只是无法让它工作.
My app has multiple pages. I've set up the StateProvider and the basic routing from page to page works. However, I am now trying to implement a tabbed view within one of these pages. I just can't get it to work.
一个基本的例子可以在这里看到:http://codepen.io/anon/pen/eBLfD
A basic example can be seen here: http://codepen.io/anon/pen/eBLfD
具体来说:1) 第一个选项卡的内容没有被加载,2) 当我将 abstract 设置为 false 时,包含选项卡的页面会被加载.
Specifically: 1) the content of the first tab doesn't get loaded and 2) when I set abstract to false the page that holds the tabs does get loaded.
我试过将 abstract 设置为 false,然后页面确实加载了,但第一个选项卡的内容没有加载.我对此很头疼 - 我错过了什么?
I've tried setting abstract to false, and then the page does load, but the contents of the first tab don't get loaded. I'm bashing my head on this- What am I missing?
推荐答案
无论你想默认哪个标签,从抽象标签继承并设置 url 为
Whichever tab you want to be the default, inherit from the abstract tab and set the url to
''
http://codepen.io/anon/pen/gApoH
这篇关于Angular UI 路由器:抽象:true 不会显示页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!