Skip to content

cino893/DOM-Events-To-Angular-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

DOM-Events-To-Angular-Converter

Angular module that converts DOM events to use it in Angular.JS way

So this is:

Another simple module that converts events we want to angularJS directive of attribute type. It works same as common angularJS event handlers. So basically it converts event to attribute with -converted-event sufix eg. 'focusout' to attribute 'focusout-converted-event'

Samples of use

At first configure events that you want to use:

angular.module('myApp',['domEventsToAngularConverter'])
.config(['domEventsToConvertProvider', function(domEventsToConvertProvider) {
        domEventsToConvertProvider.$get().push(['focusout','ondrop']);
}]);

or

angular.module('myApp',['domEventsToAngularConverter'])
.run(['domEventsToConvert', function(domEventsToConvert){
  domEventsToConvert.push(['focusout','ondrop']);
}])

Then just use it like

<input focusout-converted-event="myFunction($event, 'yourOptionalParams')"/>

Remeber to execute this script after angular and before your main module! :)

About

This module converts DOM events to use it in Angular.JS way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors