Last active
July 29, 2022 04:22
-
-
Save pavankjadda/1f5d6993bbd53a8aaa8820a33fe429a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Update parameters after user enters search text or changes page selection | |
* | |
* @author Pavan Kumar Jadda | |
* @since 2.0.0 | |
*/ | |
updateRouteParameters($event: PageEvent | null) { | |
const params = { | |
pageIndex: this.paginator.pageIndex, | |
pageSize: this.paginator.pageSize, | |
searchText: this.searchTextControl?.value?.trim() ?? '', | |
sortBy: this.sort.active, | |
sortDirection: this.sort.direction, | |
}; | |
const urlTree = this.router.createUrlTree(['/employee/all'], { | |
relativeTo: this.route, | |
queryParams: params, | |
queryParamsHandling: 'merge', | |
}); | |
//Update route with Query Params | |
this.location.go(urlTree.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment