You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
As of 1.1.5, using ngInclude on a page that has a path that does not end with a hash or a slash and without configuring the $routeProvide.html5Mode causes a redirect.
For example: http://server/base -> http://server/base#/base
This seems to be by design since in the spec mentions that html5 history should correctly convert html5 url with path matching basepath to hashbang url:
I suggest that this behavior should be opt-in since I don't think generally people would be expecting to be using the $location whenever ngInclude is used. Even the use of $route just for the autoscroll functionality seems a little overkill. Perhaps provide a way to disable $location (or just its redirects) or make the setup explicit (perhaps requiring the user to include $location as an explicit dependency on their module configuration.
A user might expect a redirect when using $route but not when using $location. It seems a little unusual that $location would simply cause a redirect through $locationProvider.$get.
The text was updated successfully, but these errors were encountered:
I also vote for this, as I'm seeing this problem. Just by adding ng-include to the page the browser location is changed and the hash is included, even if I'm not using $route or $location. So a way to disable this behavior would be appreciated.
As of 1.1.5, using
ngInclude
on a page that has a path that does not end with a hash or a slash and without configuring the$routeProvide.html5Mode
causes a redirect.For example:
http://server/base -> http://server/base#/base
Here is a live example:
Open the live preview and append
index.html
in http://plnkr.co/edit/5uW6HBun5AAwMJ7QYUq4Or, if it works: http://run.plnkr.co/BRvHmL7ookHPdxAN/index.html
Steps to reproduce:
index.html
to url.Source of problem
This comes from the recent change to the URL interception behavior 58ef323 .
Refer to:
angular.js/src/ng/location.js
Lines 540 to 543 in 58ef323
This seems to be by design since in the spec mentions that html5 history should correctly convert html5 url with path matching basepath to hashbang url:
angular.js/test/ng/locationSpec.js
Lines 582 to 591 in 58ef323
I suggest that this behavior should be opt-in since I don't think generally people would be expecting to be using the
$location
wheneverngInclude
is used. Even the use of$route
just for theautoscroll
functionality seems a little overkill. Perhaps provide a way to disable$location
(or just its redirects) or make the setup explicit (perhaps requiring the user to include$location
as an explicit dependency on their module configuration.A user might expect a redirect when using
$route
but not when using$location
. It seems a little unusual that$location
would simply cause a redirect through$locationProvider.$get
.The text was updated successfully, but these errors were encountered: