Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

Key with array index saves as object unless array already exists #706

Closed
philjolly opened this issue Aug 18, 2016 · 1 comment
Closed

Key with array index saves as object unless array already exists #706

philjolly opened this issue Aug 18, 2016 · 1 comment

Comments

@philjolly
Copy link
Contributor

If i use a key that contains an array index i.e. things[0].stuff it will only save as an array if i have manually added an empty array to the model before a value is entered. If the parent node is empty it saves as an object with a key of "0".

http://jsbin.com/giwihenoyi/edit?html,js,output

@philjolly
Copy link
Contributor Author

philjolly commented Aug 18, 2016

Well nevermind... as I started picking through the code to see if I could find a fix I realized its an issue with angular.$parse and they wont fix it... angular/angular.js#9850 closing in frustration Reopened issue to follow guidelines for a forthcoming PR

@philjolly philjolly reopened this Aug 19, 2016
philjolly pushed a commit to philjolly/angular-formly that referenced this issue Aug 19, 2016
angular. does not (and will not angular/angular.js#9850) properly
handle arrays in keys unless they have already been created in the model. This fix/feature adds a
separate parser for these circumstances and a formlyConfig.extras flag to control its use. The flag
is in place to minimize impact on current functionality of the setter.

This is in support of formly-js#706
kentcdodds pushed a commit that referenced this issue Sep 6, 2016
angular. does not (and will not angular/angular.js#9850) properly
handle arrays in keys unless they have already been created in the model. This fix/feature adds a
separate parser for these circumstances and a formlyConfig.extras flag to control its use. The flag
is in place to minimize impact on current functionality of the setter.

This is in support of #706
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants