addyosmani / addyosmani/mustache-for-chromeapps

Processing a value through a global helper (middleware)

Đang mở
#3 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
28
Fork
8
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.