سؤال

http://jsfiddle.net/x3azn/ZRVyF/

for this sample, how can I change the formatting to be done on the input, so that input displays

<input val='0.00'>

and I type 1

<input val='0.01'>

and I type 9 and 9

<input val='1.99'>
هل كانت مفيدة؟

المحلول

I couldn't think of an easier way to achieve this but to create your own directive, so you can listen the keyboard event on the input element and format the output accordingly. This SO question might be helpful: How can I detect onKeyUp in AngularJS?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top