-
Notifications
You must be signed in to change notification settings - Fork 27.4k
angular ngRoute breaks when using base tag #4442
Comments
looks like a duplicate of #3511 unsure |
changing line https://github.com/angular/angular.js/blob/master/src/ng/location.js#L56 to:
|
The problem is that |
This issue doesn't seem to exist in the latest build from master. Here is a plunkr showing that - http://plnkr.co/edit/LqWdroJBtM3O5iUiOVL7?p=preview |
@siddii nope, the problem is still there, you just forgot the base tag updated the code to the latest version |
There are two issues, one is probably very difficult to change at this point.
We might need an alternative way to bootstrap the application, like a way to specify the "real" base url in a config block before $locationProvider.$get is ever called. I notice that PRs are welcome =) |
… path In HTML, the <base> tag is used to configure how relative hyperlinks are resolved. In Angular, it has another use, configuring how URLs are rewritten. Because of this, setting the base URL to some external path outside of the application would cause $location.$$parse() to throw (which is the desired behaviour). This change enables developers to imperatively configure the application basePath, taking advantage of the natural HTML use of the <base> tag without breaking Angular applications. Example: ``` angular.module("test", []) .config(function($locationProvider) { $locationProvider.baseHref("http://foo.com/the/base/application/path/"); }); ``` Closes angular#4442
… path In HTML, the <base> tag is used to configure how relative hyperlinks are resolved. In Angular, it has another use, configuring how URLs are rewritten. Because of this, setting the base URL to some external path outside of the application would cause $location.$$parse() to throw (which is the desired behaviour). This change enables developers to imperatively configure the application basePath, taking advantage of the natural HTML use of the <base> tag without breaking Angular applications. Example: ``` angular.module("test", []) .config(function($locationProvider) { $locationProvider.baseHref("http://foo.com/the/base/application/path/"); }); ``` Closes angular#4442
Using AJS 1.3.4 when HTML5mode is true ... AngularJS doesn't work at all.. Getting Error TypeError: Url is undefined. |
@levarberry do you have a stack trace? please file a bug with more information, thanks! |
Basically this is a request for the ngAppRoot directive: #3102 |
Demo:
http://plnkr.co/edit/TkADpfgchYVdvNTqRPFT?p=preview
Apparently it's because of the new changes to this: b019a48
It dose not complain when you are actually on that same url as the base href
The text was updated successfully, but these errors were encountered: