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

Feature Request: fmt

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

描述

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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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