如何将 Jade 输出与 angular 过滤器混合
How to Mix Jade output with angular filters
我有一个正在从 ejs 模板引擎转换为 jade 的应用程序。
在我的 ejs 视图中我有这个
<input class="form-control" value="{{<%=User.outlet.money%> | currency}}" type="text" name="money" data-parsley-required="true"/>
几乎将我的数字输出转换为货币输出。
在我的 jade 应用程序中我有这个
input.form-control(value= User.outlet.money, type='text', name='money')
我想要更多类似的东西。
input.form-control(value= {{User.outlet.money | currency}}, type='text', name='money')
如何让 angular 个过滤器过滤 jade 输出?
您可以使用 interpolation.
示例:
input(value="{{#{User.outlet.money} | currency}}", type="text", name="money")
对于 User.outlet.money
==2
结果将是:
input(value="{{2 | currency}}", type="text", name="money")
我有一个正在从 ejs 模板引擎转换为 jade 的应用程序。
在我的 ejs 视图中我有这个
<input class="form-control" value="{{<%=User.outlet.money%> | currency}}" type="text" name="money" data-parsley-required="true"/>
几乎将我的数字输出转换为货币输出。
在我的 jade 应用程序中我有这个
input.form-control(value= User.outlet.money, type='text', name='money')
我想要更多类似的东西。
input.form-control(value= {{User.outlet.money | currency}}, type='text', name='money')
如何让 angular 个过滤器过滤 jade 输出?
您可以使用 interpolation.
示例:
input(value="{{#{User.outlet.money} | currency}}", type="text", name="money")
对于 User.outlet.money
==2
结果将是:
input(value="{{2 | currency}}", type="text", name="money")