Include Form Renderer in your Angular application
Once Form Renderer is installed there is a couple of things you need to.
Add schema
Add CUSTOM_ELEMENTS_SCHEMA
to the @NgModule.schemas
of component that is using form-renderer
as a Web Component:
import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
@NgModule({
// ...
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
Add script
Add a reference to the form-renderer.js
script from the package, as a scripts array entry in angular.json
:
"scripts": [
{
"input": "node_modules/@better/form-renderer/form-renderer.js"
}
]
Add style sheet
Add a reference to the styles.css
style sheet from the package, as a styles array entry in angular.json
. This reference
should be added after the global styles:
"styles": [
"src/styles.scss",
"node_modules/@better/form-renderer/styles.css"
]