emberjs / emberjs/rfcs

{{else}} should render a value rather than be a control-flow keyword.

Open
#917 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
801
Forks
409
PR merge metrics
No merged PRs in 30d

Description

One thing I noticed as I am both going through the [Svelte tutorial](https://svelte.dev/tutorial/else-blocks) again as well as writing a similar one for Ember / ``, is that `{{else}}` is is syntactically incoherent.

Everywhere else, we use `{{ identifier }}` to render a value _except_ for `{{else}}`.

For consistency, I think we should fix that.
Svelte uses a "continuation" syntax to denote that a block is continuing.

So for us, that would look like this:
```hbs
{{#if condition}}

{{:else if otherCondition}}

{{:else}}

{{/if}}
```
which has 0 ambiguity with value-rendering.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.