Skip to content

Commit 99ee765

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

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

guides/release/components/conditional-content.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,17 @@ Like many programming languages, Ember also allows you to write `if else` and
107107
{{/if}}
108108
```
109109

110-
An important feature of `if` statement is that it can be used only inside an
111-
HTML element or another block. For example following snippet won't work
112-
because it uses ``if`` statement **on** the HTML element:
110+
The block form of the `if` statement is typically used to wrap
111+
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.
113112

114-
```handlebars {data-filename="app/components/sign-in.hbs"}
115-
{{!-- Won't work --}}
116-
<button {{#if @disabled}} disabled {{/if}} class="btn">Sign In</button>
117-
```
118-
119-
Correct usage:
113+
Here's an example of a block `if`, wrapping some HTML elements:
120114

121115
```handlebars {data-filename="app/components/sign-in.hbs"}
122116
{{#if @disabled}}
123117
<button disabled class="btn">Sign In</button>
124118
{{else}}
125119
<button class="btn">Sign In</button>
126120
{{/if}}
127-
```
128121
129122
## Inline `if`
130123

0 commit comments

Comments
 (0)