SCION Workbench | Projects Overview | Changelog | Contributing | Sponsoring |
---|
SCION Workbench > How To Guides > View
A start page can be used to display content when all views are closed.
To display a start page, register an empty path route, as follows:
import {bootstrapApplication} from '@angular/platform-browser';
import {provideRouter} from '@angular/router';
bootstrapApplication(AppComponent, {
providers: [
provideRouter([
{path: '', loadComponent: () => import('./start-page/start-page.component')},
]),
],
});
Different perspectives can have a different start page. Use the canMatchWorkbenchPerspective
guard to match a route only if the specified perspective is active.
import {bootstrapApplication} from '@angular/platform-browser';
import {provideRouter} from '@angular/router';
import {canMatchWorkbenchPerspective} from '@scion/workbench';
bootstrapApplication(AppComponent, {
providers: [
provideRouter([
// Match this route only if 'perspective-a' is active.
{
path: '',
loadComponent: () => import('./perspective-a/start-page.component'),
canMatch: [canMatchWorkbenchPerspective('perspective-a')],
},
// Match this route only if 'perspective-b' is active.
{
path: '',
loadComponent: () => import('./perspective-b/start-page.component'),
canMatch: [canMatchWorkbenchPerspective('perspective-b')],
},
]),
],
});