javascript - Template not updating and $http not firing requests when using custom directive -


i'm trying create custom directive handle paste event , i've come with:

app.directive('ngpaste', function(){     var obj = {         compile: function(element, attrs) {             return function(scope, elem, attrs){                 elem.bind('paste', function() {                     var funcname = attrs.ngpaste.replace('(', '').replace(')', '');                     if(typeof(scope[funcname]) == 'function') {                         settimeout(function(){                             scope.$apply(scope[funcname]);                         }, 10);                     }                 });             };         }     };     return obj; }); 

the problem models change on callback don't update template , $http object not fire request. must missing simple but, unfortunately, docs quite lacking on theses matters.

how can solve this?

thanks,

the problem was using angular 1.1.4 unstable. downgraded 1.1.1 (which unstable has functionality need) , problem doesn't happen anymore.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -