Skip to content

tfoxy/angular.mailcheck

Repository files navigation

angular.mailcheck

npm version bower version build status

Reduce user-misspelled email addresses in your angular forms.

Requirements

Load into your app

You can get it from Bower

bower install angular.mailcheck

or npm

npm install angular.mailcheck

Load the script files in your application:

<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/mailcheck/src/mailcheck.js"></script>
<script type="text/javascript" src="bower_components/angular.mailcheck/angular-mailcheck.js"></script>

Add the specific module to your dependencies:

angular.module('myApp', ['tf.mailcheck', ...])

Usage examples

Live demo

<div>
  <input
    type="email"
    ng-model="vm.email"
    tf-mailcheck="vm.suggestion"
  />
  <div ng-if="vm.suggestion">
    Did you mean 
    <a href ng-click="vm.email = vm.suggestion.full">
      {{vm.suggestion.full}}</a>?
  </div>
</div>


<!-- Pass options with tf-mailcheck-options -->
<!-- Options: https://github.com/mailcheck/mailcheck#usage-without-jquery -->
<div>
  <input
    type="email"
    ng-model="vm.email2"
    tf-mailcheck="vm.suggestion2"
    tf-mailcheck-options="{secondLevelDomains: ['foobar']}"
  />
  <div ng-if="vm.suggestion2">
    Did you mean 
    <a href ng-click="vm.email2 = vm.suggestion2.full">
      {{vm.suggestion2.full}}</a>?
  </div>
</div>

About

Reduce user-misspelled email addresses in your angular forms

Resources

License

Stars

Watchers

Forks

Packages

No packages published