File

src/session/dcm/session_route_provider.ts

Description

Strategy interface for providing the route path for rendering a specific Blueriq session, used for handling project changes in new tabs. This is an alternative to using the BlueriqConfig.sessionRoute option as provided using BlueriqModule.forRoot, which may be too limited for certain use-cases.

Installing a custom session route provider requires that an implementation is registered as provider for the SessionRouteProvider token. If this provider occurs in a separate NgModule, please be aware that the NgModule must then be imported after BlueriqModule.forRoot to override the default implementation.

Example

import { NgModule, Injectable } from '@angular/core';
import { SessionRouteProvider } from '@blueriq/angular';
import { SessionId } from '@blueriq/core';

@Injectable()
export class MySessionRouteProvider implements SessionRouteProvider {
  provideRoutePath(sessionId: SessionId): string {
    return `/session/${sessionId}`;
  }
}

@NgModule({
  // ...
  providers: [
    // ...
    { provide: SessionRouteProvider, useClass: MySessionRouteProvider },
  ],
  // ...
})
export class AppModule {}

Index

Methods

Methods

Abstract provideRoutePath
provideRoutePath(sessionId: SessionId)

Given the session id to load, a path string should be returned that will then be opened in a new tab. Note that the returned route path must not include the base href.

Parameters :
Name Type Optional Description
sessionId SessionId No

The session id to load, which is just a string.

Returns : string

the route path to redirect to, excluding base href!

results matching ""

    No results matching ""