test/fixtures/sample-files/query-param-group.service.ts
Service implementing the synchronization logic
This service is the key to the synchronization process by binding a QueryParamGroup to the router.
Properties |
|
Methods |
|
Accessors |
constructor(routerAdapter: RouterAdapter, globalRouterOptions: RouterOptions)
|
|||||||||
|
Parameters :
|
| Public deregisterQueryParamDirective | ||||||
deregisterQueryParamDirective(queryParamName: string)
|
||||||
|
Deregisters a QueryParamAccessor by referencing its name.
Parameters :
Returns :
void
|
| Private enqueueNavigation | ||||||
enqueueNavigation(data: NavigationData)
|
||||||
|
Sends a change of parameters to the queue.
Parameters :
Returns :
void
|
| Private getParamsForValue | |||||||||
getParamsForValue(queryParam: QueryParam
|
|||||||||
Type parameters :
|
|||||||||
|
Returns the full set of parameters given a value for a parameter model. This consists mainly of properly serializing the model value and ensuring to take side effect changes into account that may have been configured.
Parameters :
Returns :
Params
|
| Private isSyntheticNavigation |
isSyntheticNavigation()
|
|
Returns true if the current navigation is synthetic.
Returns :
boolean
|
| Private navigateSafely | ||||||
navigateSafely(data: NavigationData)
|
||||||
|
Parameters :
Returns :
Observable<any>
|
| Public registerQueryParamDirective | ||||||
registerQueryParamDirective(directive: QueryParamAccessor)
|
||||||
|
Registers a QueryParamAccessor.
Parameters :
Returns :
void
|
| Private serialize | |||||||||
serialize(queryParam: QueryParam
|
|||||||||
Type parameters :
|
|||||||||
|
Parameters :
Returns :
string | []
|
| Public setQueryParamGroup | ||||||
setQueryParamGroup(queryParamGroup: QueryParamGroup)
|
||||||
|
Uses the given QueryParamGroup for synchronization.
Parameters :
Returns :
void
|
| Private setupGroupChangeListener |
setupGroupChangeListener()
|
|
Listens for programmatic changes on group level and synchronizes to the router.
Returns :
void
|
| Private setupNavigationQueue |
setupNavigationQueue()
|
|
Subscribes to the parameter queue and executes navigations in sequence.
Returns :
void
|
| Private setupParamChangeListener | ||||||
setupParamChangeListener(queryParamName: string)
|
||||||
|
Parameters :
Returns :
void
|
| Private setupParamChangeListeners |
setupParamChangeListeners()
|
|
Listens for programmatic changes on parameter level and synchronizes to the router.
Returns :
void
|
| Private setupRouterListener |
setupRouterListener()
|
|
Listens for changes in the router and synchronizes to the model.
Returns :
void
|
| Private startSynchronization |
startSynchronization()
|
|
Returns :
void
|
| Private watchNewParams |
watchNewParams()
|
|
Listens for newly added parameters and starts synchronization for them.
Returns :
void
|
| Private directives |
Type : unknown
|
Default value : new Map<string, QueryParamAccessor[]>()
|
|
List of QueryParamAccessor registered to this service. |
| Private queryParamGroup |
Type : QueryParamGroup
|
|
The QueryParamGroup to bind. |
| Private queue$ |
Type : unknown
|
Default value : new Subject<NavigationData>()
|
|
Queue of navigation parameters A queue is used for navigations as we need to make sure all parameter changes are executed in sequence as otherwise navigations might overwrite each other. |
| routerOptions |
getrouterOptions()
|
|
Returns the current set of options to pass to the router. This merges the global configuration with the group specific configuration.
Returns :
RouterOptions
|