Skip to content

Commit d438c4a

Browse files
ciurjenweber
authored andcommitted
Update guides/release/components/conditional-content.md
Co-authored-by: Jen Weber <[email protected]>
1 parent e7a5922 commit d438c4a

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

guides/release/components/conditional-content.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -243,29 +243,13 @@ It looks similar to a ternary operator.
243243
{{if condition value1 value2}}
244244
```
245245

246-
Similarly to block `if`, you need to pay attention where inline `if` is placed
247-
otherwise ember will be confused. Inline `if` can be used only inside attributes values
248-
of HTML element. For example:
246+
Similarly to block `if`, you need to pay attention where inline `if` is placed.
247+
Inline `if` can be used only inside attribute values
248+
of HTML elements. For example:
249249

250250
```handlebars {data-filename="app/components/spinner.hbs"}
251251
<span class="spinner {{if @inProgress 'visible' 'invisible'}}">
252252
</span>
253-
```
254-
255-
In example above, inline ``if`` is correctly used inside class attribute value.
256-
257-
On the other hand, if you intend to use inline ``if`` to add "disabled"
258-
attribute to the HTML element:
259-
260-
```handlebars {data-filename="app/components/spinner.hbs"}
261-
{{!-- Won't work (!) --}}
262-
<span {{if @disabled 'disabled' }}">
263-
</span>
264-
```
265-
266-
Ember will get confused and will complain with an error. In example above
267-
Ember will see `if` as modifier instead and complain about incorrect usage of
268-
modifier.
269253
270254
271255
## Learn More

0 commit comments

Comments
 (0)