mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-26 03:00:25 +00:00
fix(location): correctly rewrite Html5 urls
This commit is contained in:
parent
0fbf584643
commit
77ff108555
1 changed files with 3 additions and 2 deletions
|
|
@ -119,13 +119,14 @@ function LocationHtml5Url(appBase, basePrefix) {
|
|||
};
|
||||
|
||||
this.$$rewrite = function(url) {
|
||||
var appUrl;
|
||||
var appUrl, prevAppUrl;
|
||||
|
||||
if ( (appUrl = beginsWith(appBase, url)) !== undefined ) {
|
||||
prevAppUrl = appUrl;
|
||||
if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) {
|
||||
return appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
|
||||
} else {
|
||||
return appBase;
|
||||
return appBase + prevAppUrl;
|
||||
}
|
||||
} else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) {
|
||||
return appBaseNoFile + appUrl;
|
||||
|
|
|
|||
Loading…
Reference in a new issue