formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.23k stars 406 forks source link

fix(formlyConfig): fix defaultOptions override behavior #680

Closed seibs closed 8 years ago

seibs commented 8 years ago

What

When the defaultOptions of a type are defined as a function and a different type extends it, the defaultOptions of the extending type are not correct.

Why

It is a bug.

How

The ordering in the reverseDeepMerge() function was reversed and the incorrect object was being returned. This change flips the parameters and returns the correct object.

For issue #635

Checklist:

Fix the override behavior when the extended type's defaultOptions field is defined as a function.

Closes #635

kentcdodds commented 8 years ago

Hi @seibs! Thanks for the PR! This looks great to me, could I have someone from @formly-js/angular-formly-collaborators or @formly-js/angular-formly-collaborators-read review this as well?

gillchristian commented 8 years ago

LGTM :)