formly-js / angular-formly

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

[feature request] global read only mode for forms #650

Open drbourbon opened 8 years ago

drbourbon commented 8 years ago

I am working on a project involving forms with rule-based editability. As a rule of thumb, validation would be disabled, "submit" buttons hidden and editable form elements would become labels.

Instead of overriding custom types as proposed in #216, IMO it'd be interesting to implement some kind of global read only mode for forms at the library level. What do you think?

Many thanks in advance!

kentcdodds commented 8 years ago

I would recommend you write your own directive that has default options you can use and passes those to formly-form. It's much better to compose things together than to have global options. Anyone want to provide an example of this?