fix(location): dartium does not like pushState with null.
According to https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history the value of the title parameter is irrelevant anyways.
This commit is contained in:
parent
01d5c29513
commit
c2a42d5d2b
|
@ -36,7 +36,7 @@ export class Location {
|
||||||
|
|
||||||
go(url:string) {
|
go(url:string) {
|
||||||
url = this._stripBaseHref(url);
|
url = this._stripBaseHref(url);
|
||||||
this._browserLocation.pushState(null, null, url);
|
this._browserLocation.pushState(null, '', url);
|
||||||
}
|
}
|
||||||
|
|
||||||
forward() {
|
forward() {
|
||||||
|
|
|
@ -27,14 +27,14 @@ export function main() {
|
||||||
|
|
||||||
it('should normalize urls on navigate', () => {
|
it('should normalize urls on navigate', () => {
|
||||||
location.go('/my/app/user/btford');
|
location.go('/my/app/user/btford');
|
||||||
expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, null, '/user/btford');
|
expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, '', '/user/btford');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove index.html from base href', () => {
|
it('should remove index.html from base href', () => {
|
||||||
browserLocation.baseHref = '/my/app/index.html';
|
browserLocation.baseHref = '/my/app/index.html';
|
||||||
location = new Location(browserLocation);
|
location = new Location(browserLocation);
|
||||||
location.go('/my/app/user/btford');
|
location.go('/my/app/user/btford');
|
||||||
expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, null, '/user/btford');
|
expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, '', '/user/btford');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should normalize urls on popstate', inject([AsyncTestCompleter], (async) => {
|
it('should normalize urls on popstate', inject([AsyncTestCompleter], (async) => {
|
||||||
|
|
Loading…
Reference in New Issue