diff --git a/guides/release/components/conditional-content.md b/guides/release/components/conditional-content.md index 92328d49b4..d502514b3d 100644 --- a/guides/release/components/conditional-content.md +++ b/guides/release/components/conditional-content.md @@ -114,6 +114,17 @@ Like many programming languages, Ember also allows you to write `if else` and {{/if}} ``` +The block form of the `if` statement is typically used to wrap +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. + +Here's an example of a block `if`, wrapping some HTML elements: + +```handlebars {data-filename="app/components/sign-in.hbs"} + {{#if @disabled}} + + {{else}} + + {{/if}} ## Inline `if` @@ -225,6 +236,14 @@ It looks similar to a ternary operator. {{if condition value1 value2}} ``` +Similarly to block `if`, you need to pay attention where inline `if` is placed. +Inline `if` can be used only inside attribute values +of HTML elements. For example: + +```handlebars {data-filename="app/components/spinner.hbs"} + + + ## Learn More