Skip to content

Commit e6d17d4

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

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

guides/release/components/conditional-content.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,17 @@ Like many programming languages, Ember also allows you to write `if else` and
114114
{{/if}}
115115
```
116116

117-
An important feature of `if` statement is that it can be used only inside an
118-
HTML element or another block. For example following snippet won't work
119-
because it uses ``if`` statement **on** the HTML element:
117+
The block form of the `if` statement is typically used to wrap
118+
HTML elements or another block. If you want to use `if` inside of an HTML element, keep reading to learn about how to use inline `if` instead.
120119

121-
```handlebars {data-filename="app/components/sign-in.hbs"}
122-
{{!-- Won't work --}}
123-
<button {{#if @disabled}} disabled {{/if}} class="btn">Sign In</button>
124-
```
125-
126-
Correct usage:
120+
Here's an example of a block `if`, wrapping some HTML elements:
127121

128122
```handlebars {data-filename="app/components/sign-in.hbs"}
129123
{{#if @disabled}}
130124
<button disabled class="btn">Sign In</button>
131125
{{else}}
132126
<button class="btn">Sign In</button>
133127
{{/if}}
134-
```
135128
136129
## Inline `if`
137130

0 commit comments

Comments
 (0)