migrate @umbraco-cms/controller to libs

This commit is contained in:
Jacob Overgaard
2023-01-20 13:28:41 +01:00
parent 9815303c90
commit e53ee08093
10 changed files with 23 additions and 37 deletions

View File

@@ -0,0 +1,27 @@
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;
}
}