【发布时间】:2018-01-20 08:06:58
【问题描述】:
我有一个数字类型的输入框,我在其中使用了 ng-model,它是一个数组,当数组为空时,输入将值显示为 0,但是当我输入数字时,现有的零不会被删除,并且它显示以 0 为起始的值。
Eg: Instead of 5 it shows as 05
HTML:
<input stopccp decimalpoint
type="number"
placeholder="{{'ededuction_message' | translate}} - {{ vm.singleproduct.selectedtype === 'piece' ? 'Pec' : 'Kg' }}"
ng-model="vm.total_amount[$index]"
id="field2"
>
控制器:
vm.total_amount = [];
我怎么能只显示我输入的值而不是显示零作为前缀。
【问题讨论】:
标签: javascript arrays angularjs ionic-framework