Skip to content

Commit 096f85c

Browse files
authored
Merge pull request ember-learn#613 from betocantu93/components/yields
ember-learn#588 components/yields
2 parents c15483f + beb4f84 commit 096f85c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

guides/release/components/yields.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ compose components just like you would HTML elements:
1818
Users can pass a block to your component, but by default your component doesn't
1919
know where to put it. You have to decide this by using the `{{yield}}` helper:
2020

21-
```handlebars {data-filename=app/components/modal-dialog/template.hbs}
21+
```handlebars {data-filename=app/templates/components/modal-dialog.hbs}
2222
<dialog>
2323
{{yield}}
2424
</dialog>
@@ -61,11 +61,11 @@ then nothing will be done with the block.
6161
### Conditionally Yielding
6262

6363
You can check whether or not a user passed a block to the component with the
64-
`hasBlock` helper:
64+
`(has-block)` helper:
6565

66-
```handlebars {data-filename=app/components/modal-dialog/template.hbs}
66+
```handlebars {data-filename=app/templates/components/modal-dialog.hbs}
6767
<dialog>
68-
{{#if hasBlock}}
68+
{{#if (has-block)}}
6969
{{yield}}
7070
{{else}}
7171
Default Message
@@ -95,7 +95,7 @@ function in JavaScript. Consider for instance the `ModalDialog` component -
9595
let's say we want to make the dialog show _conditionally_ when we click a
9696
button:
9797

98-
```handlebars {data-filename=app/components/modal-dialog/template.hbs}
98+
```handlebars {data-filename=app/templates/components/modal-dialog.hbs}
9999
{{#if this.showModal}}
100100
<dialog>
101101
{{yield}}
@@ -107,7 +107,7 @@ button:
107107
</button>
108108
```
109109

110-
```js {data-filename=app/components/modal-dialog/component.js}
110+
```js {data-filename=app/components/modal-dialog.js}
111111
import Component from '@glimmer/component';
112112
import { tracked } from '@glimmer/tracking';
113113
import { action } from '@ember/object';
@@ -128,7 +128,7 @@ those buttons are going to be!
128128

129129
What we can do here is _yield_ the `toggleModal` action:
130130

131-
```handlebars {data-filename=app/components/modal-dialog/template.hbs}
131+
```handlebars {data-filename=app/templates/components/modal-dialog.hbs}
132132
{{#if this.showModal}}
133133
<dialog>
134134
{{yield this.toggleModal}}

0 commit comments

Comments
 (0)