IT

[angular] Handling queryParams

로바아토 2018. 3. 23. 09:13

We can navigate to edit component with this code.

this.router.navigate(['edit'],{relativeTo: this.route});


but here is my question.

How to preserve the queryParams?

It is simple!. look at this one.

this.router.navigate(['edit'],{relativeTo: this.route, queryParamsHandling: 'preserve'});


just Add queryParamsHandling with preserve.