Angularjs how to apply currency filter to input type = number?

Here is the Plunkr I created: http://plnkr.co/edit/T9nrjP1LePGYwF8C0yBH

I am using the $ currency filter and formatting the inputs type="text"

.

Now how can I do the same for input type="number"

?

Angularjs will set the model to undefined if you type any letters other than a number.

Any help would be appreciated.

+3
javascript jquery angularjs angularjs-directive


source to share


No one has answered this question yet

Check out similar questions:

1668
How can I format numbers as a currency string in JavaScript?
1535
How to print a number with commas as thousands separators in JavaScript
1073
How to use $ scope. $ Watch and $ scope. $ Apply in AngularJS?
721
How do I set focus to an input field?
289
AngularJS - create directive that uses ng-model
262
When writing a directive in AngularJS, how can I decide if I need a new area, a new child area, or a new isolated area?
217
HTML5: number input type that only accepts integers?
108
filters on ng-model in input
12
angular.js - wrapping currency symbol and decimal numbers in between
4
AngularJS - How to apply currency filter in a textbox as you type?



All Articles
Loading...
X
Show
Funny
Dev
Pics