File

libs/ngx-pfe/services/pfe-page-mapping-service/page-definition.ts

Description

A PageDefinition contains the component for a page.

Index

Properties

Constructor

constructor(pageComponent?: Type<>)
Parameters :
Name Type Optional
pageComponent Type<> Yes

Properties

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;
    }
  }
}

results matching ""

    No results matching ""