Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/libs/controller/controller.class.ts
2023-01-20 13:28:41 +01:00

28 lines
650 B
TypeScript

import { UmbControllerHostInterface } from './controller-host.mixin';
import { UmbControllerInterface } from './controller.interface';
export abstract class UmbController implements UmbControllerInterface {
protected host?: UmbControllerHostInterface;
private _alias?: string;
public get unique() {
return this._alias;
}
constructor(host: UmbControllerHostInterface, alias?: string) {
this.host = host;
this._alias = alias;
this.host.addController(this);
}
abstract hostConnected(): void;
abstract hostDisconnected(): void;
public destroy() {
if (this.host) {
this.host.removeController(this);
}
delete this.host;
}
}