Skip to content

Commit a2efa83

Browse files
committed
feat(mailcheck ): add email suggestion validator, closes #44
1 parent ecdf479 commit a2efa83

File tree

8 files changed

+533
-117
lines changed

8 files changed

+533
-117
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ import {EmailValidators} from 'ngx-validators'
151151

152152
email: FormControl = new FormControl('', EmailValidators.normal);
153153
email2: FormControl = new FormControl('', EmailValidators.simple);
154+
email3: FormControl = new FormControl('', EmailValidators.suggest);
154155
```
155156

156157
### Universal
@@ -247,12 +248,23 @@ export class AppModule {
247248
```
248249

249250
### Email
251+
252+
#### Normal
253+
250254
```html
251255
<form>
252256
<input type="text" [(ngModel)]="model.email" name="email" #formControl="ngModel" email>
253257
<span *ngIf="formControl.hasError('normalEmailRule')">Is not a email</span>
254258
</form>
259+
```
260+
261+
#### Suggest
255262

263+
```html
264+
<form>
265+
<input type="text" [(ngModel)]="model.email" name="email" #formControl="ngModel" emailSuggest>
266+
<span *ngIf="formControl.hasError('suggestion')">Maybe check the mail again</span>
267+
</form>
256268
```
257269

258270
### Universal
@@ -306,7 +318,6 @@ export class AppModule {
306318

307319
##Todo
308320

309-
* Implement https://github.com/mailcheck/mailcheck
310321
* Add more password rules
311322
* Add address validator
312323

package.json

Lines changed: 73 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,76 @@
11
{
2-
"name": "ngx-validators",
3-
"version": "0.0.0-development",
4-
"description": "An implementation of angular validators for Angular 2 and higher",
5-
"scripts": {
6-
"test": "karma start",
7-
"test-watch": "karma start --no-single-run --auto-watch",
8-
"build": "tslint --project . && ng-packagr -p package.json",
9-
"lint": "tslint --project .",
10-
"commit": "tslint --project . && npm test && git-cz",
2+
"name": "ngx-validators",
3+
"version": "0.0.0-development",
4+
"description": "An implementation of angular validators for Angular 2 and higher",
5+
"scripts": {
6+
"test": "karma start",
7+
"test-watch": "karma start --no-single-run --auto-watch",
8+
"build": "tslint --project . && ng-packagr -p package.json",
9+
"commit": "tslint --project . && npm test && git-cz",
1110
"lint": "tslint --project .",
12-
"semantic-release": "semantic-release",
13-
"travis-deploy-once": "travis-deploy-once"
14-
},
15-
"repository": {
16-
"type": "git",
17-
"url": "https://github.com/Nightapes/ngx-validators.git"
18-
},
19-
"keywords": [
20-
"angular",
21-
"angular2+",
22-
"validators"
23-
],
24-
"author": "Sebastian Beisch",
25-
"license": "MIT",
26-
"bugs": {
27-
"url": "https://github.com/Nightapes/ngx-validators/issues"
28-
},
29-
"homepage": "https://github.com/Nightapes/ngx-validators",
30-
"peerDependencies": {
31-
"@angular/common": ">= 2.0.0",
32-
"@angular/core": ">= 2.0.0",
33-
"@angular/forms": ">= 2.0.0"
34-
},
35-
"devDependencies": {
36-
"@angular/cli": "^7.0.2",
37-
"@angular/common": "^7.0.0",
38-
"@angular/compiler": "^7.0.0",
39-
"@angular/compiler-cli": "^7.0.0",
40-
"@angular/core": "^7.0.0",
41-
"@angular/forms": "^7.0.0",
42-
"@angular/platform-browser": "^7.0.0",
43-
"@angular/platform-browser-dynamic": "^7.0.0",
44-
"@types/google-libphonenumber": "^7.4.10",
45-
"@types/jasmine": "2.8.8",
46-
"@types/node": "^10.9.4",
47-
"codelyzer": "^4.2.1",
48-
"commitizen": "2.10.1",
49-
"cz-conventional-changelog": "2.1.0",
50-
"jasmine-core": "3.2.1",
51-
"karma": "3.0.0",
52-
"karma-chrome-launcher": "2.2.0",
53-
"karma-jasmine": "1.1.2",
54-
"karma-typescript": "^3.0.12",
55-
"ng-packagr": "^4.1.1",
56-
"rxjs": "^6.2.1",
57-
"rxjs-compat": "^6.2.1",
58-
"semantic-release": "^15.9.14",
59-
"travis-deploy-once": "^5.0.7",
60-
"tsickle": "^0.33.1",
61-
"tslib": "^1.9.3",
62-
"tslint": "^5.9.1",
63-
"typescript": "3.1.3",
64-
"zone.js": "^0.8.26"
65-
},
66-
"config": {
67-
"commitizen": {
68-
"path": "node_modules/cz-conventional-changelog"
11+
"semantic-release": "semantic-release",
12+
"travis-deploy-once": "travis-deploy-once"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/Nightapes/ngx-validators.git"
17+
},
18+
"keywords": [
19+
"angular",
20+
"angular2+",
21+
"validators"
22+
],
23+
"author": "Sebastian Beisch",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/Nightapes/ngx-validators/issues"
27+
},
28+
"homepage": "https://github.com/Nightapes/ngx-validators",
29+
"peerDependencies": {
30+
"@angular/common": ">= 2.0.0",
31+
"@angular/core": ">= 2.0.0",
32+
"@angular/forms": ">= 2.0.0"
33+
},
34+
"devDependencies": {
35+
"@angular/cli": "^7.0.2",
36+
"@angular/common": "^7.0.0",
37+
"@angular/compiler": "^7.0.0",
38+
"@angular/compiler-cli": "^7.0.0",
39+
"@angular/core": "^7.0.0",
40+
"@angular/forms": "^7.0.0",
41+
"@angular/platform-browser": "^7.0.0",
42+
"@angular/platform-browser-dynamic": "^7.0.0",
43+
"@types/google-libphonenumber": "^7.4.10",
44+
"@types/jasmine": "2.8.8",
45+
"@types/node": "^10.9.4",
46+
"codelyzer": "^4.2.1",
47+
"commitizen": "2.10.1",
48+
"cz-conventional-changelog": "2.1.0",
49+
"jasmine-core": "3.2.1",
50+
"karma": "3.0.0",
51+
"karma-chrome-launcher": "2.2.0",
52+
"karma-jasmine": "1.1.2",
53+
"karma-typescript": "^3.0.12",
54+
"ng-packagr": "^4.1.1",
55+
"rxjs": "^6.2.1",
56+
"rxjs-compat": "^6.2.1",
57+
"semantic-release": "^15.9.14",
58+
"travis-deploy-once": "^5.0.7",
59+
"tsickle": "^0.33.1",
60+
"tslib": "^1.9.3",
61+
"tslint": "^5.9.1",
62+
"typescript": "3.1.3",
63+
"zone.js": "^0.8.26"
64+
},
65+
"config": {
66+
"commitizen": {
67+
"path": "node_modules/cz-conventional-changelog"
68+
}
69+
},
70+
"dependencies": {},
71+
"ngPackage": {
72+
"lib": {
73+
"entryFile": "./src/public_api.ts"
74+
}
6975
}
70-
},
71-
"dependencies": {},
72-
"ngPackage": {
73-
"lib": {
74-
"entryFile": "./src/public_api.ts"
75-
}
76-
}
77-
}
76+
}

0 commit comments

Comments
 (0)