Skip to content

Commit 702d724

Browse files
ciurjenweber
andauthored
Update guides/release/components/conditional-content.md
Co-authored-by: Jen Weber <weberj10@gmail.com>
1 parent e828b25 commit 702d724

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
@@ -236,29 +236,13 @@ It looks similar to a ternary operator.
236236
{{if condition value1 value2}}
237237
```
238238

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

243243
```handlebars {data-filename="app/components/spinner.hbs"}
244244
<span class="spinner {{if @inProgress 'visible' 'invisible'}}">
245245
</span>
246-
```
247-
248-
In example above, inline ``if`` is correctly used inside class attribute value.
249-
250-
On the other hand, if you intend to use inline ``if`` to add "disabled"
251-
attribute to the HTML element:
252-
253-
```handlebars {data-filename="app/components/spinner.hbs"}
254-
{{!-- Won't work (!) --}}
255-
<span {{if @disabled 'disabled' }}">
256-
</span>
257-
```
258-
259-
Ember will get confused and will complain with an error. In example above
260-
Ember will see `if` as modifier instead and complain about incorrect usage of
261-
modifier.
262246
263247
264248
## Learn More

0 commit comments

Comments
 (0)