I navigate to a certain page in my app with a query parameter. After I get the parameter from the URL I want to delete it, ideally I would have this:
I would suggest this way that is compatible with all routing strategies of Angular X:
this.route.queryParams.subscribe(params => { let token = params['jwt']; if (token) { this.cache.set({t: 't'}, token); window.location.href = this.router.url.split('?')[0]; } });