How to Append Prefix Value in AngularJs model text box dynamically

  angularjs, html, javascript

I have over 50 text box elements in page. I am trying to append minus symbol in every text box after enter value (ng-blur) by using one common javascript function. but i am unable to pass ng-model name to javascript function from jsp element ng-blur call to append minus symbol after enter value. any solution.

JSP element:

    <input type="text" maxlength="10" 
ng-blur="appendMinusSymbol('buzz.model1')" ng-model="buzz.model1"/>

    <input type="text" maxlength="10" 
ng-blur="appendMinusSymbol('buzz.model2')" ng-model="buzz.model2"/>

JS Function:

$scope.appendMinusSymbol = function(model){
// append minus symbol as prefix to ng model value
};

Source: AngularJS Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.