ngx-schema-form
ngx-schema-form copied to clipboard
How access to model.
Hi, i have implemented a custom external button. How can reset the form filed for example on "Cancel" button? I need to use external button.
Your button can call a method that will set the model to {}
.
Aah ok, great! It seems to work. But now, i have difficult to access it on "Send button".
i have this:
<sf-form (isValid)="validateForm($event)" #addForm (onChange)="onFormChange($event)" [schema]="addRecordForm" [model]="addRecordModel"></sf-form>
on my button if i try to
console.log(JSON.stringify(this.addRecordModel));
it print a undefined value. But if i try to set addRecordModel to {}
it restore the field.