MacKentoch / easyFormGenerator

create amazing forms without coding : form editor based on angular formly
http://mackentoch.github.io/easyFormGenerator/
MIT License
254 stars 116 forks source link

Use custom field templates #72

Open darshik opened 7 years ago

darshik commented 7 years ago

We have our own directives created for all the fields to be used in any form page. I saw Kent C. Dodds contributed the datepicker in easy form generator. Is there a way, we can use non angular formly templates for fields?

MacKentoch commented 7 years ago

Hi,

I'm not sure to understand what you mean by using non angular formly templates for fields.

If you mean adding custom component or control, yes you can add.

If you are successfull to add it to angular form then tell me and I will integrate it in easyFormGenerator for you (since it is not strait forward).

How to create your custom component:

I added nya-bootstrap-select in my early days of angular formly here.

Inspire from all examples it is even faster then reading the documentation (angular formly is huge).

Just train on JSBin when it seems ok for you keep the code and send me.

darshik commented 7 years ago

Basically, we have directives written for each of the fields used for our forms. So, for example, the text input directive that we have, can we use that to replace the text input template?

The link that you gave seems good enough to start. Will update you once I have it working. Might add some new controls to (possibly timepicker).

MacKentoch commented 7 years ago

If you create a new input template I can add it.

EasyFormGenerator is built for open source and based on bootstrap.

If you want to replace you have to fork easyFormGenerator and do it yourself for your own needs. It won't be easyFormGenerator anymore. It will be your form generator (deleted all you don't want and added all you want like you want).

You are free to take it and make yours (license MIT could be do what you want to licence too)