简体   繁体   中英

How to enable event default in anchor click in Angular ui-router

Basically I'm asking this gentleman's question: How to disable static url in angular ui-router?

My DOM structure looks like this:

<div ui-view>
  <a href="/link-to-non-angular-page">Click Me</a>
</div>

I want people to be able to click that "Click Me" link and have it force the page to take you to that page as if Angular and UI Router didn't exist, as a standard HTTP page request with everything reloading.

Is that doable?

So @Daemedeor answered my question in above comments. The solution is to add this to the link:

target="_self"

So the above markup would turn into:

<div ui-view>
  <a href="/link-to-non-angular-page">Click Me</a>
</div>

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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