如何将玉石输出与角度滤镜混合

时间:2016-01-06 14:38:13

标签: javascript angularjs pug

我有一个应用程序,我正在从ejs模板引擎转换为jade。

在我的ejs视图中我有这个

<input class="form-control" value="{{<%=User.outlet.money%> | currency}}"   type="text" name="money" data-parsley-required="true"/>

几乎将我的数字输出转换为货币输出。

在我的玉器应用程序中,我有这个

input.form-control(value= User.outlet.money, type='text', name='money')

我想要更像这样的东西。

input.form-control(value= {{User.outlet.money | currency}}, type='text', name='money')

如何通过角度滤镜实现玉石输出过滤?

1 个答案:

答案 0 :(得分:1)

您可以使用interpolation

示例:

input(value="{{#{User.outlet.money} | currency}}", type="text", name="money")

对于User.outlet.money == 2,结果将为:

input(value="{{2 | currency}}", type="text", name="money")