How to use Angular ui.bootstrap tabs with ui.router?

前端 未结 3 965
無奈伤痛
無奈伤痛 2020-12-31 11:06

Here\'s my initial implementation of ui.bootstrap tabs using ui.router:


  
            


        
3条回答
  •  余生分开走
    2020-12-31 11:18

    The easiest way is to ignore all the fancy ui-bootstrap directives and just make use of the CSS. Then you can end up with something very simple:

    
    

    This will give the appearance of the tabs while maintaining a correct active states. The trouble with using the directive is that you can't cleanly initialize the active state from the ui-router $state, so you get multiple tabs highlighted on page load.

提交回复
热议问题