formly-js / angular-formly

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

defaultOptions specified as function not overriden in extending types #635

Closed redhead closed 8 years ago

redhead commented 8 years ago

With a chain of extending formly types, each having a function in defaultOptions, it does not override same-key options of the parent in more "concrete" types.

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

I don't know if that's intentional if using a function as defaultOptions, but I thought it should work regardless.

kentcdodds commented 8 years ago

This appears to be a bug. defaultOptions should work great as a function. But it appears to not work in this case. However, if we make the abstractType an object instead, it seems to work fine (like so).

I doubt that I'll have time to work on this I'm afraid. But feel free to makeapullrequest.com :-)