Ngx-formly: Reset Model at once

Created on 28 Apr 2018  路  1Comment  路  Source: ngx-formly/ngx-formly

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request
[x] Question

In this example https://stackblitz.com/angular/gkmymknklla
If I want to use resetModel then I have to write
this.options[0].resetModel();
This will reset the first tab. Is it possible to reset all the tab at once instead of resetting each tab
one after the other?

  • Angular version: 5.0
question

>All comments

just create a function resetAll that reset all options at once:

resetAll() {
  this.options.forEach(option => option.resetModel());
}
Was this page helpful?
0 / 5 - 0 ratings