Socket
Socket
Sign inDemoInstall

angular-weblineindia-email

Package Overview
Dependencies
10
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-weblineindia-email

AngularJS based Email component, provides option to add single / multiple email input field with validation. The email value is automatically validated on blur event. You can change validation message using props. You can also disable email field using di


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

AngularJS - Email Input Component with Validation

AngularJS based Email component, provides option to add single / multiple email input field with validation. The email value is automatically validated on blur event. You can change validation message using props. You can also disable email field using disable props.

Table of contents

  • Browser Support
  • Demo
  • Getting started
  • Usage
  • Available Props
  • Methods
  • Want to Contribute?
  • Collection of Components
  • Changelog
  • License
  • Keywords

Browser Support

ChromeFirefoxSafariEdgeIE
83.0 ✔77.0 ✔13.1.1 ✔83.0 ✔11.9 ✔

Demo

Getting started

Install the npm package:

npm install angular-weblineindia-email
#OR
yarn add angular-weblineindia-email

Usage

Use the <angular-weblineindia-email> component:

Add in app.module.ts file

import { NgModule } from "@angular/core";
import { EmailModule } from "angular-weblineindia-email";

@NgModule({
  imports: [EmailModule]
})
export class AppModule {}

Add in app.component.ts file

import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons";

export class AppComponent {
  faPlus: any = faPlus;
  faMinus: any = faMinus;

  values: any = [{ email: "" }];

  emailValue: any = {
    placeholder: "Enter Email",
    maxlength: 50,
    emailFormateError: "Email is not valid",
    duplicateEmailError: "Do not enter same email",
    name: "email",
    id: "email",
    disabled: false,
    value: "",
    isMultiple: true,
    isShowPlus: true,
    tabindex: 0,
    index: 0
  };

  onFocus(event) {
    event.target.placeholder = "";
  }

  onBlur(event) {
    event.target.placeholder = this.emailValue.placeholder;
  }

  onChange(data) {
    this.values[data.index].email = data.event.target.value;
  }

  onAddMultipleEmail() {
    this.values.push({ email: "" });
  }
}

Add in app.component.html file

<div *ngFor="let value of values;let indexOfelement=index;">
  <lib-email
    [placeholder]="emailValue.placeholder"
    [maxlength]="emailValue.maxlength"
    [emailFormateError]="emailValue.emailFormateError"
    [duplicateEmailError]="emailValue.duplicateEmailError"
    [name]="emailValue.name"
    [id]="emailValue.id"
    [disabled]="emailValue.disabled"
    [value]="value.email"
    [isMultiple]="emailValue.isMultiple"
    [isShowPlus]="values.length-1 === indexOfelement"
    [tabindex]="emailValue.tabindex"
    [index]="indexOfelement"
    [emailArray]="values"
    (focus)="onFocus($event)"
    (blur)="onBlur($event)"
    (change)="onChange($event)"
    (onPlus)="onAddMultipleEmail()"
  ></lib-email>
</div>

Available Props

PropTypedefaultDescription
maxlengthNumber50maxlength for email
idStringemail id
emailFormateErrorStringEmail is not validemail formate validation
duplicateEmailErrorStringDo not enter same emailduplicate email error
onMultipleEmailFunctionwhen click on plus icon on email
nameStringemailemail name.
indexNumber0email index.
emailArrayArray[Object][{email : ''}]email default array
isMultipleBooleantrueflag to implement multiple email
isShowPlusBooleanfalseflag to show plus icon for add multiple email
placeholderStringEmailemail placeholder
disabledBooleanfalsedisable input field
tabindexNumber0email tabIndex
valueStringemail value

Methods

NameDescription
focusGets triggered when the input field receives focus.
blurGets triggered when the input field loses focus.
changeGets triggered every time when input got changed.
onPlusGets triggered every time when click on plus button.

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT

Keywords

angular-weblineindia-email, email-validation-component, email-input, angularjs-email-input, multi-email-input

Keywords

FAQs

Last updated on 20 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc