0.0.4 • Published 1 year ago

@lewn/ng-dynamic-form-builder v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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.

StackBlitz Demo

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>
0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago