Angular update query params without ui reload

  • Language:: Javascript

  • Type:: Front End

  • Context:: update query params

  • Description – a text-based description of the snippet

  • Snippet

updateQueryParams() {
        const queryParams: Params = { date_from: this.queryDateFrom, status_id: this.queryStatusId };

        this.router.navigate([], {
            relativeTo: this.activatedRoute,
            queryParams: queryParams,
            queryParamsHandling: "merge", // remove to replace all query params by provided
        });
    }

📇Additional Metadata