【问题标题】:Bootstrap collapse with Angular routerBootstrap 使用 Angular 路由器崩溃
【发布时间】:2014-12-09 11:03:23
【问题描述】:

我使用 Bootstrap 折叠作为示例 http://getbootstrap.com/javascript/#collapse

由于我使用Angular路由器,在localhost/#/flow页面,我应该如何设置href的折叠?

<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="collapseOne">

如果我将其设置为href="collapseOne"href="/#/flow/collapseOne"href="/#/flow/#collapseOne",Angular 路由器会将其路由到localhost/#/

如果我将其设置为href="/#/flow",则显示为Uncaught Error: Syntax error, unrecognized expression: #/flow

那么我应该如何设置href 以在停留在当前页面时启用折叠?

【问题讨论】:

标签: html angularjs twitter-bootstrap


【解决方案1】:

试试这个:data-target="yourID"。 Twitter 允许数据属性,它对我有用。

顺便说一句,如果您使用的是 Angular,为什么不使用由 AngularUI 团队重写的 Bootstrap 端口AngularUI's Bootsrap Components

【讨论】:

    猜你喜欢
    • 2018-08-22
    • 1970-01-01
    • 2014-09-18
    • 2013-09-04
    • 1970-01-01
    • 1970-01-01
    • 2021-11-25
    • 2021-01-16
    • 1970-01-01
    相关资源
    最近更新 更多