|
|
|
@ -1,3 +1,4 @@ |
|
|
|
import { FORM_PROP, FORM_PROP_DATA } from './../../tokens/extensions.token'; |
|
|
|
import {ABP, AbpValidators, ConfigStateService, TrackByService} from '@abp/ng.core'; |
|
|
|
import { |
|
|
|
AfterViewInit, |
|
|
|
@ -30,8 +31,7 @@ import {FormProp} from '../../models/form-props'; |
|
|
|
import {PropData} from '../../models/props'; |
|
|
|
import {selfFactory} from '../../utils/factory.util'; |
|
|
|
import {addTypeaheadTextSuffix} from '../../utils/typeahead.util'; |
|
|
|
import {FORM_PROP_DATA_STREAM} from "../../tokens/extensions.token"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-extensible-form-prop', |
|
|
|
templateUrl: './extensible-form-prop.component.html', |
|
|
|
@ -181,16 +181,20 @@ export class ExtensibleFormPropComponent implements OnChanges, AfterViewInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ngOnChanges({prop}: SimpleChanges) { |
|
|
|
ngOnChanges({prop,data}: SimpleChanges) { |
|
|
|
const currentProp = prop?.currentValue as FormProp; |
|
|
|
const {options, readonly, disabled, validators, template} = currentProp || {}; |
|
|
|
if (template) { |
|
|
|
this.injectorForCustomComponent = Injector.create({ |
|
|
|
providers: [ |
|
|
|
{ |
|
|
|
provide: FORM_PROP_DATA_STREAM, |
|
|
|
provide: FORM_PROP, |
|
|
|
useValue: currentProp |
|
|
|
}, |
|
|
|
{ |
|
|
|
provide: FORM_PROP_DATA, |
|
|
|
useValue: (data?.currentValue as PropData)?.record |
|
|
|
}, |
|
|
|
{ provide: ControlContainer, useExisting: FormGroupDirective } |
|
|
|
], |
|
|
|
parent: this.injector, |
|
|
|
|