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

Closed
pjlnmix opened this Issue Aug 18, 2016 · 1 comment

Projects

None yet

2 participants

@pjlnmix
Contributor
pjlnmix commented Aug 18, 2016

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

@pjlnmix
Contributor
pjlnmix commented Aug 18, 2016 edited

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

@pjlnmix pjlnmix closed this Aug 18, 2016
@pjlnmix pjlnmix reopened this Aug 19, 2016
@pjlnmix pjlnmix added a commit to pjlnmix/angular-formly that referenced this issue Aug 19, 2016
@pjlnmix pjlnmix feat(formly-field): Adds parser for keys that contain arrays
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
7f8601c
@kentcdodds kentcdodds added a commit that referenced this issue Sep 6, 2016
@pjlnmix @kentcdodds pjlnmix + kentcdodds feat(formly-field): Adds parser for keys that contain arrays (#709)
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
fc45fb3
@kentcdodds kentcdodds closed this Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment