【发布时间】:2014-01-11 10:40:47
【问题描述】:
我有 html
<input type="text" ng-model="price" >
<h2>{{ price | currency}}</h2>
在控制器中
$scope.price = 10;
Which displays **$10** in h1 if i change the value in price model input.
我希望文本框输入为货币(输入框中的 10 美元作为值)。 如何做到这一点?
【问题讨论】:
-
抱歉我之前的回答,我没有正确阅读你的问题。请在下面尝试我的新答案演示。
标签: javascript jquery angularjs filter angularjs-directive