Created
October 23, 2018 14:17
-
-
Save jagomf/6d161697cab59df6018146a7477b8dfa to your computer and use it in GitHub Desktop.
Angular: Append a query parameter to current route without navigating
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ActivatedRoute, Router, NavigationExtras } from '@angular/router'; | |
... | |
const extras: NavigationExtras = { | |
relativeTo: this.route, | |
queryParams: { name: value }, | |
queryParamsHandling: 'merge' | |
}; | |
this.router.navigate([], extras).then(() => { /* continue here */ }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment