0

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?

9
  • can't you perform e.preventDefault() and change window.location to the url you need ? Commented Dec 30, 2015 at 1:07
  • doable yes... just capture it on the server but this requires us to know the server implementation Commented Dec 30, 2015 at 1:11
  • @DinoMyte I could definitely do that but if the user CTRL + clicked the link (or CMD + clicked on a Macintosh) then they'd expect the thing to open in a new tab, and unfortunately you can't reliably do that in a web browser with just JavaScript. Ideally the solution would simply allow the native functionality to occur without any JavaScrip hacks. Commented Dec 30, 2015 at 1:25
  • @Daemedeor Sorry, I'm afraid that's not making any sense. :) This is strictly a client-side question here. Commented Dec 30, 2015 at 1:25
  • 1
    might wanna go here then: stackoverflow.com/questions/20980201/… Commented Dec 30, 2015 at 3:58

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.