angular routing adding unwanted hash tags to URL (angular 1.1.5)

318 views
Skip to first unread message

Paolo Milani Comparetti

unread,
Jun 28, 2013, 1:48:50 PM6/28/13
to ang...@googlegroups.com
Hi,

there seems to be an issue in angularjs 1.1.5 routing where if there is a "/" route and a user navigates directly to it, spurious hash tags are appended by the framework. E.g., "http://myhost.com/mypage.html" becomes "http://myhost.com/mypage.html#/mypage.html".

There is a stackoverflow question here:

http://stackoverflow.com/questions/17350412/angularjs-1-1-5-automatically-adding-hash-tag-to-urls

And a test-case showing the behavior in the issue I submitted:

https://github.com/angular/angular.js/issues/3083

This is not expected behavior is it? I am going to have to roll my site back to 1.1.4 for now I think...

ciao
Paolo

fess

unread,
Jun 28, 2013, 2:06:27 PM6/28/13
to ang...@googlegroups.com
I think it's a bug, see also,

https://github.com/angular/angular.js/issues/2833

some work was done to change handling of what the "base url" was of the app, and how to handle it. that work seems to have broken things in both html5 mode https://github.com/angular/angular.js/issues/2762 fixed by igorMinar here: https://github.com/angular/angular.js/commit/aef098006302689d2d75673be828e31903ee7c3c but a similar bug still exists with html5 mode off which I think you're seeing.

as I mentioned in 2833, i started to write some tests to cover this case, and try to fix it. (https://github.com/fessyfoo/angular.js/commit/efd44f68e93ff83b4bd07b598c01f0727aec677e) but I'm not totally sure of my assumptions as to what's "correct".

--fess
> --
> You received this message because you are subscribed to the Google Groups "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Paolo Milani Comparetti

unread,
Jun 28, 2013, 2:19:53 PM6/28/13
to ang...@googlegroups.com


On Friday, 28 June 2013 11:06:27 UTC-7, fess wrote:
I think it's a bug, see also,

  https://github.com/angular/angular.js/issues/2833

some work was done to change handling of what the "base url" was of the app, and how to handle it.   that work seems to have broken things in both html5 mode   https://github.com/angular/angular.js/issues/2762  fixed by igorMinar here: https://github.com/angular/angular.js/commit/aef098006302689d2d75673be828e31903ee7c3c    but a similar bug still exists with html5 mode off  which I think you're seeing.

as I mentioned in 2833,  i started to write some tests to cover this case, and try to fix it.   (https://github.com/fessyfoo/angular.js/commit/efd44f68e93ff83b4bd07b598c01f0727aec677e)   but I'm not totally sure of my assumptions as to what's "correct".

Thanks for the pointer Fess.

ciao
Paolo


Reply all
Reply to author
Forward
0 new messages