diff --git a/README.md b/README.md index c105576..19cde09 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ # nativescript-input-validator-ng2 Example of input validation component for nativescript ng2, using class-validator ``` -export class Login { +export abstract class BasicModel { + +} + +export class Login extends BasicModel { @IsEmail(undefined, {message:"Email invalid"}) @IsNotEmpty({message:"Email is required"}) @@ -10,6 +14,21 @@ export class Login { @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](https://cloud.githubusercontent.com/assets/22457603/23334454/9ca32b10-fb7d-11e6-84c3-734d63376ff5.png) + +![screen-book](https://cloud.githubusercontent.com/assets/22457603/23341455/cffe55f8-fc26-11e6-829f-a8488e2fefa4.png)