|
@@ -56,15 +56,22 @@ export class DynafieldDirective extends NgControl implements OnInit
|
|
|
);
|
|
|
}
|
|
|
try {
|
|
|
- const { name, class: cssClass, id: cssId } = this.meta;
|
|
|
+ const { name, class: cssClass, id: cssId, isDisabled } = this.meta;
|
|
|
+
|
|
|
+
|
|
|
const component = this.resolver.resolveComponentFactory<FFC>(formFieldComponents[type]);
|
|
|
this.component = this.container.createComponent(component);
|
|
|
const instance = this.component.instance;
|
|
|
const el = this.component.location.nativeElement;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ if (isDisabled) {
|
|
|
+ this.control.reset({ value: this.control.value, disabled: true });
|
|
|
+ }
|
|
|
instance.control = this.control;
|
|
|
instance.meta = this.meta;
|
|
|
+
|
|
|
+
|
|
|
if (cssClass) {
|
|
|
const classesToAdd = Array.isArray(cssClass) ? cssClass : [cssClass];
|
|
|
el.classList.add(...classesToAdd);
|
|
@@ -72,6 +79,8 @@ export class DynafieldDirective extends NgControl implements OnInit
|
|
|
if (cssId) {
|
|
|
el.id = cssId;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if (instance.propagateChange) {
|
|
|
|
|
|
|