generic-form-library
v0.0.2
Published
This library provides a generic form component for Angular applications. It simplifies the process of creating forms by generating form fields based on a JSON configuration.
Downloads
1
Readme
GenericFormLibrary
This library provides a generic form component for Angular applications. It simplifies the process of creating forms by generating form fields based on a JSON configuration.
Installation
To install the library, you can use npm or yarn. Run the following command in your project directory:
npm install generic-form-library
or
yarn add generic-form-library
Usage
Import the
GenericFormPluginModule
in your Angular module.Use the
lib-generic-form-plugin
component in your templates.Create a JSON object representing your form configuration. const jsonFormData = { fields: [ { type: 'text', label: 'Name', name: 'name', required: true }, { type: 'email', label: 'Email', name: 'email', required: true }, // Add more form fields as needed ] };
Customize the form fields according to your requirements.
Example
Here's an example of how to use the library with a JSON form data:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<lib-generic-form-plugin [jsonFormData]="jsonFormData"></lib-generic-form-plugin>`
})
## License
MIT © [Eklictic Group]