0

I need to create input for numbers so if user entering 10000, in input will be displayed 10 000 or 10.000, but in model in will be 10000. Tried to make something like

<input type="text" ng-model="value" ng-pattern="/(\d+)(\d{3})/">

But it doesn't works(

kliukovking
  • 569
  • 1
  • 5
  • 16

1 Answers1

0

Actually you need some trick here. You need to show it in a label but edit in a textbox. Some thing like this

<div ng-app ng-controller="InputCtrl">
<input id="id" type="number" ng-model="mynum1"><label for="id">{{mynum1 | number}}</label><br>

I've create a fiddle may be this is help full to you.

Ancient
  • 3,007
  • 14
  • 55
  • 104