ngx-formly: resetModel broken with FormArrays

I’m submitting a … (check one with “x”)

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

Current behavior The ability to reset the model via options.resetModel is broken. I’ve found that it has been broken starting with #329. The following plunker uses that build of formly: https://plnkr.co/edit/tK3LXcpGRwL3NM8rSb39?p=preview

Expected behavior The following plunker uses the build of formly at #327, one commit prior with the expected behavior: https://plnkr.co/edit/t5WgjlhyQiKxf6GfcGtY?p=preview

It’s also worth looking at the behavior of the formly demo between these two commits as there are apparent problems with the repeatSection right off the bat which shouldn’t have anything to do with the options.resetModel.

With the demo for the current build, an issue (possibly not the same) can be seen by just attempting to “Reset Model (New Model)” which should demonstrate the repeatSection not reflecting what’s in the model.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

fixed the issue of edit item, can you try again https://plnkr.co/edit/5rBWM4kjLKbRY80nLPcQ?p=preview

@aitboudad that seems to have done it, awesome work! I really appreciate your effort, especially that you’ve taken time out of your weekend to look at this.

I think we should go for Release Candidate once this bug is closed. Will have to rename the project to ng-formly and have to change it to 1.0.0-rc.0 and also probably change the url for the website from ng2 to ng

I’ll look into it