Skip to content

AngularJS ng-change like functionality for the entire form

Notifications You must be signed in to change notification settings

chenop/form-on-change

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

AngularJS ng-change like functionality for the entire form

Use Case: When given a form - we would like to call a method for every change in one of the forms fields.
For example: Update the server for each change in one of our fields.

the form-on-change directive support elements, <textarea> boxes and elements. by listening to the 'change' event so according to JQuery documentation: The change event is sent to an element when its value changes. This event is limited to input elements, textarea boxes and select elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus. Install bower install form-on-change Usage Add form-on-change.js to list of scripts: <script src="bower_components/form-on-change/form-on-change.js"></script> Add module dependency angular.module('your-app-name', ['chenop.form-on-change']); In your HTML it should look something like that: <form name="form1" form-on-change="doSomething()"> <input ng-model="formData.a"> <input ng-model="formData.b"> </form>

About

AngularJS ng-change like functionality for the entire form

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published