adopted-ember-addons / adopted-ember-addons/ember-cli-string-helpers

Feature Request: fmt

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

Mô tả

Hi!

Once in a while I need to do string concatatenation in templates. `concat` helper works, but it is not as legible as string literals.

```hbs
{{concat "var(" @varName ", " @defaulValue ")"}}
```
Something like the [old `Ember.String.fmt`](https://deprecations.emberjs.com/v2.x#toc_ember-string-fmt) would be more legible:

```hbs
{{fmt "var(%@1, %@2)", @cssVar @defaultValue}}
```
There is an implementation of this function in @GavinJoyce's [ember-string-fmt](https://github.com/GavinJoyce/ember-string-fmt/) that could be used. I don't know if his repo is a better place for this helper. What do you think?

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

Mở hướng dẫn đóng góp

Đá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.