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 has been archived by the owner on Apr 12, 2024. It is now read-only.
On full page reload in browser (ctrl f5)
$location.path() will be equal to word after last forward slash for any app url.
example
url: http://localhost:3000/some/word
$location.path() after reload will be equal to "word"
this bug affects that $routeProvider can't work for routes like
$routeProvider.when('/:id_1/:id_2', {...}) after page reload
(this code work on local html5 locations because of, if first url is equal to http://aaa/ the method stripFile returns http://aaa/ and cach result in var appBaseNoFile, so next calls to this.$$parse use normal appBaseNoFile for calculations)
fix:
add method
function stripHTML5File(url) {
var url_repl = url.replace('//','-$%^%$-'); //-$%^%$- need be replaced with some UID
return url_repl.substr(0, stripHash(url_repl).indexOf('/') + 1).replace('-$%^%$-', '//');;
}
replace var appBaseNoFile = stripFile(appBase); call from LocationHtml5Url to
var appBaseNoFile = stripHTML5File(appBase);
so LocationHtml5Url will be
function stripHTML5File(url) {
var url_repl = url.replace('//','-$%^%$-');
return url_repl.substr(0, stripHash(url_repl).indexOf('/') + 1).replace('-$%^%$-', '//');;
}
function LocationHtml5Url(appBase, basePrefix) {
basePrefix = basePrefix || '';
var appBaseNoFile = stripHTML5File(appBase);
Thank you guys for really cool application and really clean source code!!!
The text was updated successfully, but these errors were encountered:
On full page reload in browser (ctrl f5)
$location.path() will be equal to word after last forward slash for any app url.
example
url: http://localhost:3000/some/word
$location.path() after reload will be equal to "word"
this bug affects that $routeProvider can't work for routes like
$routeProvider.when('/:id_1/:id_2', {...}) after page reload
Where is no need in reproduce this bug, because of simple source:
file:
https://github.com/angular/angular.js/blob/master/src/ng/location.js
method:
stripFile called from LocationHtml5Url get url like http://aaa/bbb/ccc and returns
this part http://aaa/bbb/ but must return http://aaa/
(this code work on local html5 locations because of, if first url is equal to
http://aaa/ the method stripFile returns http://aaa/ and cach result in var appBaseNoFile, so next calls to this.$$parse use normal appBaseNoFile for calculations)
fix:
add method
replace var appBaseNoFile = stripFile(appBase); call from LocationHtml5Url to
var appBaseNoFile = stripHTML5File(appBase);
so LocationHtml5Url will be
Thank you guys for really cool application and really clean source code!!!
The text was updated successfully, but these errors were encountered: