0.0.4 • Published 10 months ago
@lewn/ng-dynamic-form-builder v0.0.4
Angular Form Dynamic Builder
This project was generated with Angular CLI version 18.1.4.
This library is designed to simplify form creation in Angular applications. It includes components that allow users to create and customize dynamic forms.
Example Usage
With TypeScript
import { Component, ViewEncapsulation } from '@angular/core';
import { DynamicFormComponent, DynamicFormBuilderComponent } from '@lewn/ng-dynamic-form-builder';
@Component({
selector: 'app-root',
standalone: true,
imports: [
DynamicFormBuilderComponent
],
encapsulation: ViewEncapsulation.None,
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
export class AppComponent {
model: any = { FirstName: '' };
customForm: DynamicFormComponent[] = [
{
value: 'FirstName', label: 'First Name', components: 'input',
prefixs: [{ type: 'icon', icon: 'person', }],
required: true,
valueChanges: (data) => {
console.log(data);
}
}
];
}
app.component.html
<dynamic-form-builder [(model)]="model" [(customForm)]="customForm"></dynamic-form-builder>