Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic angular forms #36

Open
pdonorio opened this issue Aug 6, 2016 · 5 comments
Open

Automatic angular forms #36

pdonorio opened this issue Aug 6, 2016 · 5 comments
Assignees

Comments

@pdonorio
Copy link
Owner

pdonorio commented Aug 6, 2016

They should be built with formly.

@mdantonio has already experience about this library.

@pdonorio
Copy link
Owner Author

pdonorio commented Aug 6, 2016

The most "epic win" on this subject is to create directly a form for a POST/PUT method to some REST API endpoint.

This should be possible by generating some JSON to feed formly. The JSON generation could become automatic based on the swagger documentation of the endpoint.

So this action depends on pdonorio/restapi-template#2

@pdonorio
Copy link
Owner Author

pdonorio commented Aug 6, 2016

Also another important technical decision is to choose the right angularjs option to wrap our automatic form.

In my opinion this is the greatest opportunity to write and test our first community directive by using the angularjs 1.5 component.

@mdantonio
Copy link
Collaborator

Automatic angular forms already exists in restangulask with both formly and schemaform libraries.
I started with formly but due to several issues (mainly with select inputs) i switched to schemaform (with many other issues).
At the moment neither of the two libraries are really mature for angular-material (instead both works pretty well with bootstrap).
We can simply wait for their updates (quite slow on the material branch) or we can think about a custom implementation of forms (but we have to find the effort to do that first, my agenda is full now)

Another question is about the definition schema used to build the automatic form.
Now a custom json schema is used, just because at the moment we have no other alternatives.
When swagger will be integrated onto the backend, we will upgrade the actual conversion service.

@pdonorio
Copy link
Owner Author

pdonorio commented Sep 2, 2016

Best chance we have with swagger is to automatically build the $http AJAX call, perhaps with this module, even thought is not well documented. Another (better) options is swaggerific.

Note that swagger replies with a JSON to a (JS) client. A more generic JS client, and probably the most developed and supported is swagger js. Again we get some JSON. Wondering if we could convert this JSON for our purpose or plug some library or our code to do the job. I'm not quite happy with all these intermediate steps.

Also it really looks angular material is forcing us to write our own form generator, which will require much much effort, we don't have now.

p.s. see all swagger integrations here.

@pdonorio
Copy link
Owner Author

pdonorio commented Sep 5, 2016

After a short talk, we see in formly the best option now and in the near future.

There is some fantastic support on multiple fields. Customization is pretty easy, and we may also copy and modify the material repo as template.

The one thing to investigate and solve is the md-autocomplete issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants