libs/ngx-pfe/services/pfe-page-mapping-service/page-definition.ts
A PageDefinition contains the component for a page.
Properties |
|
constructor(pageComponent?: Type<>)
|
||||||
Parameters :
|
Optional lazyPageRoute |
Type : RoutePfeLazy
|
For lazy loaded pages a Route with the loadChildren defined needs to be provided. |
Optional pageComponent |
Type : Type<>
|
import { Type } from '@angular/core';
import { LoadChildren, Route } from '@angular/router';
/**
* Extends the Angular Route and ensures that either loadChildren or
* loadComponent is set (but never both).
*/
export type RoutePfeLazy =
| (Route & {
loadChildren: LoadChildren;
loadComponent?: never;
})
| (Route & {
loadChildren?: never;
loadComponent: Route['loadComponent'];
});
/**
* A PageDefinition contains the component for a page.
*
* @export
*/
export class PageDefinition {
pageComponent?: Type<unknown>;
/**
* For lazy loaded pages a Route with the loadChildren defined needs to be provided.
*/
lazyPageRoute?: RoutePfeLazy;
constructor(pageComponent?: Type<unknown>) {
if (pageComponent) {
this.pageComponent = pageComponent;
}
}
}