somawater/deckhand — pull request #15 by elvanja (2014-03-07 00:35:37+00:00)
Title: Form choices

Changelog:
* fixed multiple items defaults
multiple values were a problem due to them being empty initially
* fixed group items defaults
related to multiple items within groups
* fixed multiple items remove bug, was:
removing the first one removes them all
removing the second one removes all after it
* fixed form initialize with defaults and params
this essentially solved the issue with defaults in all places
a major refactoring of #resolve_value took place

Choices are still an issue.
Tried recursively adding them to values but had no luck.
The problem is with multiple items that don't exist initially, and so the choices don't have a key to attach themselves too. See form#values, the commented section. This information is used in controllers#....$scope.choicesForSelect where the choices are generated to, and in /app/helpers/deckhand/templates_helper.rb#angular_input:49 where the data is bound to angular $scope.

I don't really have an idea on how to untangle this. Any suggestions welcome. I was thinking about removing choices from values altogether and just set the values in #angular_input directly, but not sure how.