src/app/state.service.ts
This service exposes an observable of the name and id of the current project. It determines the current project by listening for url changes and parsing the url.
Properties |
Methods |
|
constructor(router: Router, ps: ProjectStoreService)
|
|||||||||
Defined in src/app/state.service.ts:17
|
|||||||||
Parameters :
|
Private isProjectURL | ||||||
isProjectURL(url: string)
|
||||||
Defined in src/app/state.service.ts:57
|
||||||
Caution: If you change the routing you might have to change this function too. That is if it has the form 'projects/:id' + further stuff.
Parameters :
Returns :
boolean
true iff url is a route pertaining to a project |
syncStateWithUrl | ||||||||||||
syncStateWithUrl(router: Router, ps: ProjectStoreService)
|
||||||||||||
Defined in src/app/state.service.ts:31
|
||||||||||||
Sets up two mutually exclusive (look at filter) subscriptions to track whether we are at a url referring to a project or not. If we are at a project we retrieve information about it from the backend and make it available in the state observable
Parameters :
Returns :
void
|
state |
Type : AppState
|
Default value : {}
|
Defined in src/app/state.service.ts:16
|
state$ |
Default value : new ReplaySubject<AppState>(1)
|
Defined in src/app/state.service.ts:17
|