Answer the question
In order to leave comments, you need to log in
Creating a directive?
Application: paramount1987.github.io/angular-charges
code: https://github.com/Paramount1987/angular-charges/b...
Created a directive, hung a "change" event - works strange ('delayed') - updates data is not immediately for some reason. I don't understand what's wrong.
app.directive('editInput',function($filter){
return {
restrict: 'E',
replace: true,
template: function(elem,attr){
return '<input type="number" class="td-input-item transparent" ng-model="charge.value" />';
},
link: function(scope,element,attrs){
element.bind('change',function(event){
// PieChart.segments[$filter('searchChartId')(PieChart.segments, +attrs.index)].value = element.value;
// PieChart.update();
scope.compoteTotalSum();
scope.compoteTotalCost();
});
element.bind('blur',function(){
element.addClass('transparent');
});
element.bind('focus',function(){
element.removeClass("transparent");
});
}
};
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question