Options
All
  • Public
  • Public/Protected
  • All
Menu

RoutingSystem provides for core, other systems and modules registration of routes and hashtag routes.

see

https://github.com/collboard/collboard/issues/97 TODO: What about #hash routes

collboard-system

Hierarchy

  • AbstractSystem
    • RoutingSystem

Index

Constructors

  • Parameters

    • systems: ISystemsExtended

    Returns RoutingSystem

Properties

originalUrl: URL

Original url from startup of the application Note: Collboard normalizes URL and this method is a way how to get the original query params and other things in the URL

ready: Promise<void>

Promise which is resolved when the system is initialized and ready to use.

storageSystem: any
systems: ISystemsExtended
urlVariables: BrowserHistoryUrlStorage<RemoveIndex<IUrlVariables>>
viewUriId: BehaviorSubject<null | string>
viewUrl: Observable<URL>

Accessors

  • get home(): any
  • Returns any

  • get homeUrl(): URL
  • Returns URL

  • get isDestroyed(): boolean
  • Is this object destroyed?

    Returns boolean

  • get isReady(): boolean
  • Checks if the system is initialized and ready to use.

    Returns boolean

  • get selfUrl(): URL
  • Returns URL

Methods

  • addSubdestroyable(...subdestroyable: ITeardownLogic[]): RoutingSystem
  • Binds new registration with itself. This registration/destroyable will be destroyed with this.

    Parameters

    • Rest ...subdestroyable: ITeardownLogic[]

    Returns RoutingSystem

  • checkIsReady(): void
  • Checks if the system is initialized and ready to use. If not, throws an error. If it is, do nothing.

    Returns void

  • checkWhetherNotDestroyed(errorMessage?: string, runBeforeError?: () => void): void
  • Checks, whether the object is not destroyed

    Parameters

    • Optional errorMessage: string

      Message that will replace default one before error

    • Optional runBeforeError: () => void

      Callback runed before error is thrown; typically this can be some logging

        • (): void
        • Returns void

    Returns void

  • destroy(): Promise<void>
  • Returns Promise<void>

  • init(): Promise<void>
  • Returns Promise<void>

  • navigateBoardHome(): void
  • TODO: !! Use this in all places

    Returns void

  • navigateHome(): void
  • Returns void

  • registerQuery<TValue>(defaultParams: TValue, options?: Partial<IBrowserHistoryStorageOptions>): IObservableStorage<TValue>
  • TODO: Make this save to history and check that is is working together with urlVariabiles in routingSystem

    Type parameters

    • TValue: IJson

    Parameters

    • defaultParams: TValue
    • Optional options: Partial<IBrowserHistoryStorageOptions>

    Returns IObservableStorage<TValue>

  • isDestroyable(obj: any): obj is IDestroyable
  • Chcek whether the given object is destroyable

    Parameters

    • obj: any

    Returns obj is IDestroyable