addyosmani / addyosmani/mustache-for-chromeapps

Processing a value through a global helper (middleware)

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
28
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

In the examples a funciton that is run on a view (or model) is usually its method. Would it be possible to implement a syntax which would allow to let a model property through a global function - like a helper, say: a function to format amount as currency.

So that if we have a model:

```
{
name: Lexus,
price: 81999,
}
```

we would run the price through a helper named `amountToCurrency(amount, format)` using a syntax along `{{ ^amountToCurrency(amount, '$0.00') }}`.

Is that feasible?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。