File

src/app/shared/widgets/configuration/app.controller.ts

Index

Properties

Properties

href
href: string
Type : string
Optional
identifier
identifier: string
Type : string
Optional
module
module: string
Type : string
Optional
profile
profile: string
Type : string
Optional
import { Injector } from "@angular/core";
import { ChannelService, ControllerService } from "./app.service";
import { Controller } from "./app.configuration";

export interface AppParams {
  href?: string;
  module?: string;
  identifier?: string;
  profile?: string;
}

export interface AppControllerFactory {
  create(injector: Injector): AppController;
}

export interface AppController {
  initialize(configuration: Controller, service: ControllerService): void;

  connect(connector: ChannelService): void;

  dispose();
}

export class ControllerRegistry {
  private static APP_CONTROLLERS: Map<string, AppControllerFactory> = new Map();

  public static registerController(
    name: string,
    factory: AppControllerFactory
  ) {
    ControllerRegistry.APP_CONTROLLERS.set(name, factory);
  }

  public static get(name: string): AppControllerFactory {
    return ControllerRegistry.APP_CONTROLLERS.get(name);
  }
}

results matching ""

    No results matching ""