angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

$apply() adds "/#/" to the URL in hashbang mode

Open bbshopadmin opened this issue 13 years ago • 1 comments

Hi,

i don't use $routeProvider but UI-Router to build a single URL app.

It seems that when i call $apply() in a controller "/#/" will be added to the URL in the browser address bar. I get that behavior in hashbang mode with Angular 1.1.4 and 1.1.5 but not in 1.0.7.

"localhost:8888" (simple view) now i switch to another view and the URL changes to "localhost:8888/#/" (view with $apply() method in the controller)

It causes the browsers history function to show a back button, which is in this case useless.

Is it intended to behave like that?

Thank you!

bbshopadmin avatar May 31 '13 13:05 bbshopadmin

Sorry, i found an obsolete event listener which called $location.path(next_path) with next_path="" that added the "/#/". But only since angular 1.1.4. When i look at the changelog i can't see why since 1.1.4.

Sorry again!

bbshopadmin avatar Jun 03 '13 22:06 bbshopadmin