-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Links to outside of Angular application are getting overridden #1051
Comments
FYI this worked fine in RC10 |
we are looking into this. |
I am trying to reproduce this but having no luck. Could you create a simple test file and email it to me? Here is a starting point: https://gist.github.com/2925715 Your description is baffling. A click on the link is either .preventDefault() or do nothing. In other words we either handle the request ourselves and prevent the browser navigation, or we let the browser do its normal thing. In your case you are seeing flicker. This is strange since it would mean that you would have the browser change the URL, but then redirect back. There is no way to redirect back in JS once you leave the page as far as I know. In either case please provide a reproducible case, since i am unable to reproduce it. |
Add onclick="return false" to the link, and observe that the page URL changes when clicking the link. Replace rc12 with rc10, and the page URL no longer changes when clicking the link. |
I sent you an email w/ my example based on the angular seed project, thanks for the help! |
Look at https://gist.github.com/2925818. Both the Foo and the Bar link ignore the onclick |
can you guys test this build: http://ci.angularjs.org/job/angular.js-igor/623/artifact/build/pkg/1.0.0-199ee246/ it should contain a fix for this issue. |
So I just tested the 1.0.0-199ee246 build above, and the issue I was seeing around links being intercepted seems to be fixed. However, a new issue popped up with this build with an unhandled exception. I have a jsFiddle at http://jsfiddle.net/AndyNeville/H5Jme/ based on Misko's example above that shows it happening. Open the jsFiddle (and open your Javasacript console), then change focus away from Chrome, and then focus (click) back into the jsFiddle "result" iframe. You should see |
BTW, I just tested against the latest build, at http://ci.angularjs.org/job/angular.js-igor/627/artifact/build/pkg/1.0.0/, and I still see this exception |
1.0.0-199ee246 works for me, but I also see that error logged: Uncaught TypeError: Cannot call method 'indexOf' of undefined angular-1.0.0-199ee246.js:5012 |
Thanks guys, the released 1.0.0 version seems to fix this for me, both in the fiddle and my own code. Congratulations on the release, I can't tell you how much we appreciate the work you've done on this fantastic library!!! |
1.0.0 seems to work with no issues for me as well (at least on Chrome, haven't tested across browsers yet). Good job! |
Yay! |
When I create a relative link to a page outside of my single page Angular app (e.g.
<a href="/foo/bar">Click</a>
), there appears to be an Angular click handler which intercepts this link and won't let me follow it.To recreate this in Angular seed (rc12):
partials/partial1.html
, add this line:Open the site in a browser (
http://localhost:4000/
for me using a simple node app). It redirects me tohttp://localhost:4000/#/view1
which looks fine.Click on the "test" link, which should take you to the
http://localhost:4000/test.html
page. Instead, I see a brief flicker in the address bar and it just goes back tohttp://localhost:4000/#/view1
I'm in Chrome if that matters.
The text was updated successfully, but these errors were encountered: