formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
613 stars 461 forks source link

[Question] - How to create formio module as a Angular Library? #1043

Closed dinbtechit closed 4 months ago

dinbtechit commented 4 months ago

How to create formio module - https://github.com/formio/module-example as an angular library?

travist commented 4 months ago

You can import the core renderer in your application, through the Angular package and then add your module there.

import { Formio } from '@formio/angular';
Formio.use({
  ...
  ...
});

It should be noted that this module from this library is old and may not work as intended since it was written for the 3.x version of our renderer, and we are currently about to roll out the 5.x version.

dinbtechit commented 4 months ago

@travist - Thanks for the reply. Maybe I am not asking this question correctly.

Formio has this concept called Formio Modules (https://help.form.io/developers/modules), that allows users to customize templates, components, cssClasses, and providers. While there are examples available demonstrating the usage of Formio Modules as a separate npm package which works great. However, the development experience is a bit cumbersome as developers need to constantly rebuild the package and restart the Angular app when making changes to the module code (such as updating a template, etc.).

I would like to take advantage of the angular's hot reloading to improve my development flow. So, instead of having a separate npm package or project for this, I'm wondering if there is a way to include my custom "Formio Module" as part of my angular monorepo project as an angular library.