angular - set/edit route queries(or params) without navigating -
hi want use routes store information pagination data or filter data in queries (or params). example i'm on
app/datagrid
and want add page=2 , pagesize=10 it
app/datagrid?page=2&pagesize=10
is there way edit/set them current route without triggering route change/update?
thanks!
if adding current route, route not change. won't reload component if parameters change.
you can see example here: passing params angular 2 traditional way
this uses .navigate
command, if navigating same component displaying, won't "navigate".
alternatively, build service retains data instead of using route parameters. have example here: https://blogs.msmvps.com/deborahk/build-a-simple-angular-service-to-share-data/
the service this:
import { injectable } '@angular/core'; @injectable() export class dataservice { servicedata: string; }
but instead of servicedata
you'd have page
, pagesize
.
Comments
Post a Comment