[fix] do not overwrite chart's function names, append instead
In getValidOptionsForChart the code is
return _(chart).functions().extend(directiveOptions).map(function(s) {
return 'dc' + s.charAt(0).toUpperCase() + s.substring(1);
}).value();
The lodash function extend assumes it operates on objects, not on arrays. The effect is that array elements get replaced (the first directiveOptions.length elements of _.functions(chart) get replaced). If I now use a newer version of lodash, the order of elements returned by _.functions(...) has changed and the element 'dimension' gets replaced, which leads errors later on.
Resolution: Append the elements of directiveOptions using concat.
@smee I'll try to pull and check this out today, I need to review the recent changes to lodash, but if thats the case then this makes sense.
Also, I noticed several changes to the UMD wrapper for dist/angular-dc.js, were those manual edits you made or did the newest version of grunt-umd introduce those changes?
Those changes are the result of the grunt build. The only manual change was one line in the source file (replaced extend with concat). Am 23.02.2015 16:36 schrieb "Tom Neyland" [email protected]:
@smee https://github.com/smee I'll try to pull and check this out today, I need to review the recent changes to lodash, but if thats the case then this makes sense.
Also, I noticed several changes to the UMD wrapper for dist/angular-dc.js, were those manual edits you made or did the newest version of grunt-umd introduce those changes?
— Reply to this email directly or view it on GitHub https://github.com/TomNeyland/angular-dc/pull/34#issuecomment-75566125.
Cool, figured as much but thought I'd check
TODO: Review after #38
What's the status on this merge? Is there another work around in the meantime?
Any updates on this one?