【问题标题】:When using ui-router normal href which point to element id don't work当使用指向元素 id 的 ui-router 普通 href 时不起作用
【发布时间】:2015-04-21 23:44:14
【问题描述】:

我正在修改我们的网络以使用 ui-router 进行状态更改,效果很好。我们很少有指向元素 id 的 href,它们无法工作,而是路由到 /。如何避免它并让我们现有的 href 并行工作?

            <div class="panel">
                <div class="panel-heading">
                    <h4 class="panel-title"><a data-parent="#accordion"
                    data-toggle="collapse" class="panel-toggle" href="#faq1"><i class="fa fa-plus-square"></i>Can I viverra sit amet quam eget lacinia?</a></h4>
                </div>

                <div class="panel-collapse collapse" id="faq1">
                    <div class="panel-body">
                        Anim pariatur cliche reprehenderit, enim eiusmod high life
                        accusamus terry richardson ad squid. 3 wolf moon officia
                        aute, non cupidatat skateboard dolor brunch. Food truck
                        quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
                        sunt aliqua put a bird on it squid single-origin coffee
                        nulla assumenda shoreditch et. Nihil anim keffiyeh
                        helvetica, craft beer labore wes anderson cred nesciunt
                        sapiente ea proident. Ad vegan excepteur butcher vice lomo.
                        Leggings occaecat craft beer farm-to-table, raw denim
                        aesthetic synth nesciunt you probably haven't heard of them
                        accusamus labore sustainable VHS.
                    </div>
                </div>
            </div><!--//panel-->

【问题讨论】:

  • href 变成ui-sref 时会发生什么?
  • ui-sref 不走运。

标签: angularjs html angular-routing angular-ui-router


【解决方案1】:

我相信您需要将锚路由添加到您的角度路由中,然后确保 #blah 部分最终作为查询参数附加到路由中。

angularjs ui-router query parameters

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-14
    • 2023-03-18
    • 1970-01-01
    相关资源
    最近更新 更多