src/app/shared/widgets/configuration/app.controller.ts
Properties |
|
href |
href:
|
Type : string
|
Optional |
identifier |
identifier:
|
Type : string
|
Optional |
module |
module:
|
Type : string
|
Optional |
profile |
profile:
|
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);
}
}