migrate @umbraco-cms/controller to libs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user