0.0.6 • Published 5 years ago

login-with-dynamic-form v0.0.6

Weekly downloads
36
License
-
Repository
-
Last release
5 years ago

LoginWithValidation

This project was generated with Angular CLI version 10.0.4.

Description

An npm lib for dynamic-form

Usage

Import LoginWithDynamicFormModule in your app.module.ts file

import { LoginWithDynamicFormModule } from 'login-with-dynamic-form';

@NgModule({
  ...
  imports: [
    LoginWithDynamicFormModule
  ],
  ...
})
export class AppModule { }

After import use it in your component as follows

<lib-login-with-dynamic-form [fieldList]="fieldList" [buttonLabel]="'Login'" (formSubmit)="onSubmit($event)">

fieldList is an Array of object with following interface

{
  name: string,
  label: string,
  type: string,
  value: string,
  validators: {
    required: boolean,
    email: boolean,
    pattern: string | RegExp
  },
}

Here is the sample fieldList array

fieldList = [
    {
      name: "email",
      label: "Email",
      type: "text",
      value: '',
      validators: {
        required: true,
        email: true
      },
    },
    {
      name: "password",
      label: "Password",
      type: "password",
      value: '',
      validators: {
        required: true,
      },
    }
  ];
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago