Open mitogh opened 8 years ago
I did discuss with Andres the possibility of overriding directive templates in the app's folder. This would apply to all components, not just gforms.
Ok. But I think we need some kind of solutions similar to the way filters works in order to be more easy to update.
On May 2, 2016, at 6:24 PM, Adam Fenton notifications@github.com wrote:
I did discuss with Andres the possibility of overriding directive templates in the app's folder. This would apply to all components, not just gforms.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/moxie-leean/ng-patternlab/issues/48#issuecomment-216394035
At the moment the GForm template has a hardcoded base-template in the form HTML parsers for the form layout and the HTML to show an error if the form doesn't load from API properly.
These could be extracted into a separate file and loaded when the component bootstraps, that would enable you to customize the main templates when you work out how, though the form item rendering is currently all done in code, so you would still get a <ul>
of form elements.
Thanks for the information. Yes we need a way to be able to overwrite this kind of templates on some scenarios or specific forms.
The main thing is to be able to override individual form controls - e.g. to add the select-ul attribute directive, or add a class to an input so it renders differently form the default.
This should be tied in with patternlab. So taking the 2nd example - say we have 2 types of submit inputs (buttons) in our app - default and small. These 2 should be registered with patternlab as per normal, then we need a way of telling gforms which to use for a given form.
At the moment by default content:
Each uses his own
div
we should update this in order to make it more pluggable by allowing the override of the default structure of the form.Related with #41