fix(angular): preserve queryParams and fragment when going back (#18298)

fixes #16744
This commit is contained in:
Liam DeBeasi
2019-05-20 11:56:02 -04:00
committed by GitHub
parent da38647478
commit bdd5109dbe
4 changed files with 27 additions and 3 deletions

View File

@ -184,7 +184,16 @@ export class NavController {
if (Array.isArray(url)) {
return this.router!.navigate(url, options);
} else {
return this.router!.navigateByUrl(url, options);
/**
* navigateByUrl ignores any properties that
* would change the url, so things like queryParams
* would be ignored unless we create a url tree
* More Info: https://github.com/angular/angular/issues/18798
*/
return this.router!.navigateByUrl(
this.router!.createUrlTree([url], options)
);
}
}
}