Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
update
  • Loading branch information
fcostaprojects authored Feb 26, 2017
1 parent e103ba9 commit 2f20192
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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"})
Expand All @@ -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)

0 comments on commit 2f20192

Please sign in to comment.