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

Feature Request: fmt

Open
#264 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
74
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.