@@ -18,7 +18,7 @@ compose components just like you would HTML elements:
18
18
Users can pass a block to your component, but by default your component doesn't
19
19
know where to put it. You have to decide this by using the ` {{yield}} ` helper:
20
20
21
- ``` handlebars {data-filename=app/components/modal-dialog/template .hbs}
21
+ ``` handlebars {data-filename=app/templates/ components/modal-dialog.hbs}
22
22
<dialog>
23
23
{{yield}}
24
24
</dialog>
@@ -61,11 +61,11 @@ then nothing will be done with the block.
61
61
### Conditionally Yielding
62
62
63
63
You can check whether or not a user passed a block to the component with the
64
- ` hasBlock ` helper:
64
+ ` (has-block) ` helper:
65
65
66
- ``` handlebars {data-filename=app/components/modal-dialog/template .hbs}
66
+ ``` handlebars {data-filename=app/templates/ components/modal-dialog.hbs}
67
67
<dialog>
68
- {{#if hasBlock }}
68
+ {{#if (has-block) }}
69
69
{{yield}}
70
70
{{else}}
71
71
Default Message
@@ -95,7 +95,7 @@ function in JavaScript. Consider for instance the `ModalDialog` component -
95
95
let's say we want to make the dialog show _ conditionally_ when we click a
96
96
button:
97
97
98
- ``` handlebars {data-filename=app/components/modal-dialog/template .hbs}
98
+ ``` handlebars {data-filename=app/templates/ components/modal-dialog.hbs}
99
99
{{#if this.showModal}}
100
100
<dialog>
101
101
{{yield}}
@@ -107,7 +107,7 @@ button:
107
107
</button>
108
108
```
109
109
110
- ``` js {data-filename=app/components/modal-dialog/component .js}
110
+ ``` js {data-filename=app/components/modal-dialog.js}
111
111
import Component from ' @glimmer/component' ;
112
112
import { tracked } from ' @glimmer/tracking' ;
113
113
import { action } from ' @ember/object' ;
@@ -128,7 +128,7 @@ those buttons are going to be!
128
128
129
129
What we can do here is _ yield_ the ` toggleModal ` action:
130
130
131
- ``` handlebars {data-filename=app/components/modal-dialog/template .hbs}
131
+ ``` handlebars {data-filename=app/templates/ components/modal-dialog.hbs}
132
132
{{#if this.showModal}}
133
133
<dialog>
134
134
{{yield this.toggleModal}}
0 commit comments