<eg-progress-inline></eg-progress-inline>
</ng-container>
<ng-container *ngIf="record">
- <div class="form-group row" *ngFor="let field of fields">
+ <ng-container *ngFor="let field of fields">
+ <div class="form-group row">
<div class="col-lg-3">
<label for="{{idPrefix}}-{{field.name}}">{{field.label}}</label>
<eg-help-popover [placement]="'right'" *ngIf="field.helpText" helpText="{{field.helpTextValue}}"></eg-help-popover>
</a>
</div>
</div>
+ <ng-container *ngIf="field.append_template">
+ <ng-container
+ *ngTemplateOutlet="field.append_template; context:appendTemplateFieldContext(field)">
+ </ng-container>
+ </ng-container>
+ </ng-container>
</ng-container>
</form>
</div>
// from the default set of form inputs.
customTemplate?: CustomFieldTemplate;
+ // Follow the normal field rendering with this custom template
+ appendTemplate?: CustomFieldTemplate;
+
// help text to display via a popover
helpText?: StringComponent;
};
}
+ if (fieldOptions.appendTemplate) {
+ field.append_template = fieldOptions.appendTemplate.template;
+ field.append_context = fieldOptions.appendTemplate.context;
+ }
+
if (fieldOptions.customTemplate) {
field.template = fieldOptions.customTemplate.template;
field.context = fieldOptions.customTemplate.context;
}, fieldDef.context || {}
);
}
+ appendTemplateFieldContext(fieldDef: any): CustomFieldContext {
+ return Object.assign(
+ { record : this.record,
+ field: fieldDef // from this.fields
+ }, fieldDef.append_context || {}
+ );
+ }
save() {
const recToSave = this.idl.clone(this.record);