ngx-schema-form icon indicating copy to clipboard operation
ngx-schema-form copied to clipboard

How access to model.

Open nicolalopatriello opened this issue 7 years ago • 2 comments

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.

nicolalopatriello avatar Dec 05 '17 11:12 nicolalopatriello

Your button can call a method that will set the model to {}.

ebrehault avatar Dec 05 '17 12:12 ebrehault

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.

nicolalopatriello avatar Dec 05 '17 15:12 nicolalopatriello