1.0.0 • Published 9 years ago

angular-blur-changed v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

angular-blur-changed

Angular directive that fires an event on blur and changed.

NPM

This is a simple directive that will trigger a function when an input element is blurred AND the value has changed.

Why was this created?

The blur event always triggers an event but most of the time you only want to be notified when the actual value has changed.

Usage:

  1. Include the blur-changed-directive as a dependency for your app.

    angular.module('myApp', ['purplefox.blurchanged'])
  2. Use the directive in your view:

    <input blur-changed="myCallback" />
  3. Set a callback method in your controller:

    function myCallback(value) {
      	console.log("Value changed " + value)
      }