cdl-validateemail

This is a simple packege which is developed using javascript regular expression.

Usage no npm install needed!

<script type="module">
  import cdlValidateemail from 'https://cdn.skypack.dev/cdl-validateemail';
</script>

README

Email Validation

This is a simple packege which is developed using javascript regular expression.

Installation instruction

npm install cdl-validateemail --save

Instruction to use the package

How to use?

Please follow below instruction to implement local storage in your angular application.

//in module
import { ValidateemailModule } from 'cdl-validateemail'; 

imports: [
    ValidateemailModule
]

// In your component ts file

import { ValidateemailService } from 'cdl-validateemail';

First way to utilize service

// Extend service to utilize its functions

export class AppComponent extends ValidateemailService {

    constructor() {
        super();
    }

    ngOnInit() {

        //Return success or error message
        this.isValidEmail('test@gmail.com');
    }
}

Second way to utilize service

// Initilize service to constructor

export class AppComponent {

    constructor(private validateemailService: ValidateemailService) {
        //TODO:
    }

    ngOnInit() {

        //Return success or error message
        this.validateemailService.isValidEmail('test@gmail.com');
    }
}