I'm using Dynamic Forms in an Angular project using Teradata Colvalent, this is the data that I ask to the user:
public inputElements: ITdDynamicElementConfig[] = [
{
name: 'Risposta',
label: 'Risposta alla domanda',
type: TdDynamicElement.Input,
required: true,
default: this.selectedIntent.IntentDataRecord.Answer,
flex: 100
},
{
name: 'Descrizione',
type: TdDynamicElement.Input,
required: true,
default: this.selectedIntent.IntentDataRecord.Description,
flex: 100
},
{
name: 'Esempi',
type: TdDynamicElement.Input,
required: true,
default: this.selectedIntent.IntentDataRecord.Examples,
flex: 50
},
{
name: 'Suggerimenti',
type: TdDynamicElement.Input,
required: true,
default: this.selectedIntent.IntentDataRecord.Hint,
flex: 50
}
];
And here I use it into the HTML template:
<td-dynamic-forms [elements]="this.inputElements">
<ng-template let-element ngFor [ngForOf]="this.inputElements">
<ng-template let-control="formControl" [tdDynamicFormsError]="element.name">
<span *ngIf="control.touched || !control.pristine">
<span *ngIf="control.hasError('minlength')">Min length value: {{element.minLength}}</span>
<span *ngIf="control.hasError('maxlength')">Max length value: {{element.minLength}}</span>
</span>
</ng-template>
</ng-template>
</td-dynamic-forms>
Is there a way to retrieve the data inserted from the user so I can use it in my component (for example after a button is clicked)?