|
@@ -136,7 +136,7 @@ export class DynafieldDirective extends NgControl implements OnInit, OnChanges,
|
|
|
this.validators = [...(this.validators || []), ...(ngValidators as Array<Validator|ValidatorFn>)];
|
|
|
}
|
|
|
*/
|
|
|
- this._control = this.formGroupDirective.addControl(this);
|
|
|
+ this._control = this.formGroupDirective.addControl(this as NgControl);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.error('ERROR INSTANTIATING DYNAFORM CHILD COMPONENT', type);
|
|
@@ -158,7 +158,7 @@ export class DynafieldDirective extends NgControl implements OnInit, OnChanges,
|
|
|
|
|
|
ngOnDestroy(): void {
|
|
|
if (this.formGroupDirective) {
|
|
|
- this.formGroupDirective.removeControl(this);
|
|
|
+ this.formGroupDirective.removeControl(this as NgControl);
|
|
|
}
|
|
|
if (this.component) {
|
|
|
this.component.destroy();
|
|
@@ -173,7 +173,7 @@ export class DynafieldDirective extends NgControl implements OnInit, OnChanges,
|
|
|
}
|
|
|
|
|
|
get path(): string[] {
|
|
|
- return [...this.cc.path, this.name];
|
|
|
+ return [...this.cc.path, this.name] as string[];
|
|
|
}
|
|
|
|
|
|
get formGroupDirective(): Form | null {
|
|
@@ -197,12 +197,12 @@ export class DynafieldDirective extends NgControl implements OnInit, OnChanges,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- setCssId(cssId): void {
|
|
|
+ setCssId(cssId: string): void {
|
|
|
const el = this.component.location.nativeElement;
|
|
|
cssId ? el.setAttribute('id', cssId) : el.removeAttribute('id');
|
|
|
}
|
|
|
|
|
|
- setCssClasses(type, cssClass): void {
|
|
|
+ setCssClasses(type: string, cssClass: string|string[]): void {
|
|
|
const classList = this.component.location.nativeElement.classList as DOMTokenList;
|
|
|
const componentTypeClass = type.toLowerCase().replace('component', '');
|
|
|
classList.add(componentTypeClass);
|