https://github.com/weblineindia/angular-email-input-component
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.
https://github.com/weblineindia/angular-email-input-component
angular angular-components angular-email angular-libraries angular-mail-component angularjs angularjs-components angularjs-email-component angularjs-library email-input email-validation email-validation-input javascript-email-validation mail-validation multi-email reusable-components
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/weblineindia/angular-email-input-component
- Owner: weblineindia
- Created: 2020-07-20T10:57:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T09:05:29.000Z (about 1 year ago)
- Last Synced: 2024-04-19T10:26:56.338Z (about 1 year ago)
- Topics: angular, angular-components, angular-email, angular-libraries, angular-mail-component, angularjs, angularjs-components, angularjs-email-component, angularjs-library, email-input, email-validation, email-validation-input, javascript-email-validation, mail-validation, multi-email, reusable-components
- Language: JavaScript
- Homepage: https://www.weblineindia.com/software-development-resources.html
- Size: 195 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Angular - Email Component
A Angular based Email component used to specify an input field where the user can enter data.
## Table of contents
- [Browser Support](#browser-support)
- [Demo](#demo)
- [Getting started](#getting-started)
- [Usage](#usage)
- [Available Props](#available-props)
- [Methods](#methods)
- [Want to Contribute?](#want-to-contribute)
- [Collection of Components](#collection-of-components)
- [Changelog](#changelog)
- [License](#license)
- [Keywords](#Keywords)## Browser Support
|  |  |  |  |  |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 83.0 ✔ | 77.0 ✔ | 13.1.1 ✔ | 83.0 ✔ | 11.9 ✔ |## Demo
[](https://github.com/weblineindia/AngularJS-Email/textNg.gif)
## Getting started
Install the npm package:
```bash
npm install angular-weblineindia-email
#OR
yarn add angular-weblineindia-email
```## Usage
Use the `` component:
Add in app.module.ts file
```typescript
import { NgModule } from "@angular/core";
import { AngularWeblineindiaEmailInputModule } from "angular-weblineindia-email";@NgModule({
imports: [AngularWeblineindiaEmailInputModule],
})
export class AppModule {}
```Add in app.component.ts file
```typescript
export class AppComponent {
isInvalidEmail: boolean = false;
invalidMessage: string = "";onFocus(event: any) {}
onBlur(event: any) {}
onKeyPressHandler(event: any) {}
onKeyDownHandler(event: any): void {}
onKeyUpHandler(event: any): void {
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
const isValid = emailRegex.test(event?.target?.value);if (!isValid) {
this.isInvalidEmail = true;
this.invalidMessage = "Invalid email format";
} else {
this.isInvalidEmail = false;
this.invalidMessage = "";
}
}
}
```Add in app.component.html file
```html
```Add in app.component.css file
```typescript
::ng-deep .emailInput {
/* Add your custom styles here */
}::ng-deep .errorMessage {
/* Add your custom styles here */
}```
## Available Props
| Prop | Type | Default | Description |
| -------------- | ------- | ------- | ------------------------------------------------------------- |
| placeholder | String | | The placeholder text displayed in the input field. |
| disabled | Boolean | false | If true, disables the input field. |
| required | Boolean | false | If true, makes the input field mandatory. |
| isInvalidEmail | Boolean | false | If true, adds a styling to indicate an invalid email format. |
| invalidMessage | String | | The error message displayed when the email format is invalid. |
| class | String | | Additional CSS class(es) to apply to the input field. |
| errorClass | String | | CSS class applied when the email format is invalid. |## Methods
| Name | Description |
| -------- | ---------------------------------------------------------------- |
| focus | Gets triggered when the autocomplete input field receives focus. |
| blur | Gets triggered when the autocomplete input field loses focus. |
| KeyPress | Gets triggered when a key gets pressed. |
| KeyDown | Gets triggered when a key gets down. |
| KeyUp | Gets triggered when a key gets up. |## Want to Contribute?
- Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
- [Fork it](http://help.github.com/forking/).
- Create new branch to contribute your changes.
- Commit all your changes to your branch.
- Submit a [pull request](http://help.github.com/pull-requests/).---
## 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](https://www.weblineindia.com/software-development-resources.html)
---
## Changelog
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
## License
[MIT](LICENSE)
[mit]: https://github.com/weblineindia/AngularJS-Text-Box/blob/master/LICENSE
## Keywords
angular-weblineindia-email, email, input, angular, angular-component, email-input-component