Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 877 Bytes

File metadata and controls

34 lines (23 loc) · 877 Bytes

nativescript-input-validator-ng2

Example of input validation component for nativescript ng2, using class-validator

export abstract class BasicModel {

}

export class Login extends BasicModel  {

   @IsEmail(undefined, {message:"Email invalid"})
   @IsNotEmpty({message:"Email is required"})
   email: string;

   @IsNotEmpty({message:"Password is required"})
   password: string;
}

export class Book extends BasicModel {

   @IsNotEmpty({message:"Name is required"})
   name: string;

   @IsNotEmpty({message:"Author is required"})
   author: string;
   
   @IsNotEmpty({message:"Pages is required"})
   pages: string;

}

screen

screen-book