fix(router): navigating to the current location works (#19463)

Closes #13340

PR Close #19463
This commit is contained in:
vsavkin
2017-10-06 13:22:02 -04:00
committed by Chuck Jazdzewski
parent 1c77cdadaf
commit b67d574a95
3 changed files with 120 additions and 95 deletions

View File

@ -41,7 +41,9 @@ export class SpyLocation implements Location {
return currPath == givenPath + (query.length > 0 ? ('?' + query) : '');
}
simulateUrlPop(pathname: string) { this._subject.emit({'url': pathname, 'pop': true}); }
simulateUrlPop(pathname: string) {
this._subject.emit({'url': pathname, 'pop': true, 'type': 'popstate'});
}
simulateHashChange(pathname: string) {
// Because we don't prevent the native event, the browser will independently update the path