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

Feature Request: fmt

オープン
#264 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。