본문 바로가기

IT

[angular] Handling queryParams

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.



'IT' 카테고리의 다른 글

[angular] Outsourcing route config  (0) 2018.03.23
[angular] redirecting and wildcard  (0) 2018.03.23
[angular] router nested  (0) 2018.03.22
[angular] retrieve the data as number  (0) 2018.03.21
[angular] QueryParameters and Fragments  (0) 2018.03.21