Skip to content

#295 array on change #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

luciformed
Copy link

fix for #295, also #208 ? by calling ngModel.$setViewValue with a copy of array

@davidlgj
Copy link
Contributor

Hi @luciformed, sorry for the late reply and thanks for the PR!

I'm a bit worried about the angular.copy, especially if the array items part of the form is large and complex. I'm gonna try it out :-)

@luciformed
Copy link
Author

angular documentation is where I read you should pass copies to $setViewValue, i understand your concern with performance though.

@luciformed
Copy link
Author

dod you get the chance to give it a try?

@davidlgj
Copy link
Contributor

Sorry it's taking so long. I hope to get time to dig into this on friday.

@davidlgj
Copy link
Contributor

I see that you set the view value to trigger a the ngModel.$viewChangeListeners that sf-changed use.

I'm thinking it could be simpler to just call the onChange listener instead, that is. Something like the code here: https://github.com/Textalk/angular-schema-form/blob/development/src/directives/changed.js#L19

By the way, would you mind removing the dist/ folder and its files from PR?

@oatkiller
Copy link

Any progress with this? I need type: array and I'm adding custom validation errors representing backend errors. This is killing me :(

@grjones
Copy link

grjones commented Jul 9, 2015

I would love for this to be merged in. It fixed our problems. 👍

@luciformed
Copy link
Author

sorry I forgot this was still hanging, I'll update the PR and hopefully it gets merged

@Anthropic
Copy link
Member

@luciformed thanks for the PR, I've started maintaining the repo and starting to try and get on top of neglected PRs, could you do me a favour and remove the dist folder from the PR please?

@omrigilad
Copy link

I was just about to submit an almost identical pull request (frankly with less tests, so this one is better) that solved our problem.

From my understanding this needs to also come with a pull request to angular-schema-form-bootstrap that removes sf-changed from https://github.com/json-schema-form/angular-schema-form-bootstrap/blob/develop/src/checkboxes.html

Is this correct? Is there anything I can do to help this get merged? @Anthropic

@Anthropic
Copy link
Member

@mmgm @luciformed needs to remove the dist folder from the PR, ideally the changes would now be done against the webpack/babel branch too as that is soon to be merged into the main develop branch. But I need to write some documentation on how to work with that before then.

If you could pull @luciformed 's version to your own fork and then make a PR minus dist folder I could accept that if this one isn't updated.

@nicklasb
Copy link
Member

nicklasb commented Oct 6, 2016

@mmgm @luciformed, have you considered the proposal from @Anthropic?

@Anthropic
Copy link
Member

Anthropic commented Apr 23, 2017

I added your test case @luciformed and it now passes in the new version, thanks so much for making the PR, most of the changes in the PR were made and I migrated your test case to work with the modified test structure :)

@Anthropic Anthropic closed this Apr 23, 2017
Anthropic added a commit that referenced this pull request Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants