Skip to content

yyasinaslan/angular-easyform

Repository files navigation

Warning

This project is under development and not ready for production. Please do not use it in production.

EasyForm (Angular)

Angular Easy Form is a library that helps you to create forms in Angular with ease. It provides a set of directives and components that help you to create forms with minimal code and focusing on layout and schema.

Installation

npm i @yyasinaslan/easyform

Documentation.

Basic Usage

<easy-form [schema]="schema" (submit)="onSubmit($event)">

  <ng-container easyFormField path="firstName"/>

  <ng-container easyFormField path="lastName"/>
  
</easy-form>
import {EasyForm} from "./easy-form";

@Component({...})
export class AppComponent {
  schema = EasyForm.create({
    firstName: EasyForm.text('First Name')
      .required('First name is required')
      .minLength(3, 'First name must be at least 3 characters'),
    lastName: EasyForm.text('Last Name').required('Last name is required')
  })

  onSubmit(value: any) {
    console.log(value)
  }
}

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •