ng-email-validation
v1.0.2
Published
Angular2 - Ionic2 custom Email validation
Downloads
5
Readme
Description
Angular2 - Ionic2 custom Email validation.
Install
npm i ng-email-validation
Validators
angular2 - ionic2 built-in validators
- required
Usage
template driven
import EmailValidator
in app.module.ts as providers:
import { EmailValidator } from 'ng-email-validation';
import { AppComponent } from './app.component';
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
ListPage,
AboutPage,
DetailPage,
BindingPage,
FormValidation,
ControlMessagesComponent
],
providers: [Config, ValidationService, EmailValidator ,LoggingService, { provide: ErrorHandler, useClass: IonicErrorHandler }]
})
export class AppModule { }
import 'EmailValidator' service in your Form.ts page; than you can import it in your code as the example below:
// EmailValidator.emailValidator refers to EmailValidator service
this.userForm = this.formBuilder.group({
'email': ['', [Validators.required, EmailValidator.emailValidator]],
'password': ['', [Validators.required, ValidationService.passwordValidator]],
'currency': ['', [Validators.required, ValidationService.currencyValidator]]
});
License
MIT