简体   繁体   English

UI路由器并链接到其他页面上的定位标记?

[英]UI-router and linking to anchor tags on other pages?

I am trying to do a simple cross reference hyperlink, as in "see 'checkboxes' under the 'ui controls' section", which in plain html might be <a href="uicontrols.html#checkboxes"> 我正在尝试做一个简单的交叉引用超链接,如“请参阅'ui控件'部分的'checkboxes'”,以纯HTML格式可能是<a href="uicontrols.html#checkboxes">

In my ui-router-based app, I am trying to use 在基于ui路由器的应用中,我尝试使用

<a href="" ui-sref="elements.uicontrols({'#': 'checkboxes'})">checkboxes</a>

to go to the state/page elements.uicontrols and then the anchor tag on that page. 转到状态/页面elements.uicontrols ,然后转到该页面上的定位标记。

It doesn't work, and some Googling turned up this: https://github.com/angular-ui/ui-router/pull/1867 它不起作用,并且一些谷歌搜索出现了: https : //github.com/angular-ui/ui-router/pull/1867

Does anyone know a way to accomplish links like this? 有谁知道完成这种链接的方法吗?

You can try it may be solved your problem. 您可以尝试解决可能的问题。 you should use id in anchor tag of plain html page to create reference link. 您应该在纯HTML页面的锚标记中使用id来创建参考链接。

In ui-router-based app 在基于ui路由器的应用中

<a ui-sref="elements.uicontrols({'#':'checkboxes'})">checkboxes</a>

in plain html might be 用纯HTML可能是

<a id="checkboxes" href="uicontrols.html">check to another page link</a>

NB: should have sufficient content bellow the plain anchor tag to show that anchor tag at the top. 注意:在普通anchor标签下面应有足够的内容,以在顶部显示该锚标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM