Skip to content

Mohammadreza-Nozari/form-generator

Repository files navigation

Form Generation Angular!

form-generation easy way to create dynamic form with Angular .

Implement

   <app-form-generation [inputs]="Inputs" [config]="Config" >  </app-form-generation>

pircture

enter image description here

Example

 export class Customer {  
          FirstName?: string;  
          LastName?: string;  
        }
 Inputs?:Array<InputModel<Customer>>;  
 Config?:ConfigModel<Customer>;
this.Inputs = new Array<InputModel<Customer>>();  
this.Inputs=[  
      {Name:x=>x.FirstName,Title:"First Name",Description:"Please set first name",InputType: InputType.Text,Validations: [Validators.required,Validators.minLength(10)]  } as InputModel<Customer>,  
      {Name:x=>x.LastName,Title:"Last Name",Description:"Please set last name",InputType: InputType.Text } as InputModel<Customer>,  
     
      {Name:x=>x.FirstName,Title:"Insert",Description:"Please set first name",InputType:InputType.Button,onClick:(item)=>{  
          console.log("insert",item);  
        }  
      } as InputModel<Customer>,  
      
      ]; 

Defination

Input Type

name decription
Text create text input
Number create Number input
PhoneNumber create phone number input
Email create Email input
Date create Date picker input
CheckBox create CheckBox input
Radio create Radio input
List create List select element
DatePeriod create Date picker input
Button create Button

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published