Skip to content

Commit 7d35c2d

Browse files
authored
Merge pull request ember-learn#672 from ember-learn/editting-pass/octane
[OCTANE] Editing Pass
2 parents 88c3f76 + 9507615 commit 7d35c2d

17 files changed

+93
-510
lines changed

guides/release/components/arguments-and-attributes.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,33 @@ a class than completely override the existing ones. For `class`, the order of
234234
`...attributes` will determine the order of merging. Putting it before:
235235

236236
```handlebars
237-
<p ...attributes class="friend-greeting">Hello {{@friend}}, I'm {{this.name}}!</p>
237+
<p ...attributes class="friend-greeting">
238+
Hello {{@friend}}, I'm {{this.name}}!
239+
</p>
238240
```
239241

240242
Results in:
241243

242244
```html
243-
<p class="red-alert friend-greeting">Hello {{@friend}}, I'm {{this.name}}!</p>
245+
<p class="red-alert friend-greeting">
246+
Hello {{@friend}}, I'm {{this.name}}!
247+
</p>
244248
```
245249

246250
And putting it after:
247251

248252
```handlebars
249-
<p class="friend-greeting" ...attributes>Hello {{@friend}}, I'm {{this.name}}!</p>
253+
<p class="friend-greeting" ...attributes>
254+
Hello {{@friend}}, I'm {{this.name}}!
255+
</p>
250256
```
251257

252258
Results in:
253259

254260
```html
255-
<p class="friend-greeting red-alert">Hello {{@friend}}, I'm {{this.name}}!</p>
261+
<p class="friend-greeting red-alert">
262+
Hello {{@friend}}, I'm {{this.name}}!
263+
</p>
256264
```
257265

258266
#### Attributes and Modifiers

guides/release/components/defining-a-component.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ember generate component blog-post
4848

4949
This will create a few different files:
5050

51-
```
51+
```bash
5252
installing component
5353
create app/components/blog-post.js
5454
create app/templates/components/blog-post.hbs
@@ -136,10 +136,9 @@ Here, we have two different kinds of dynamic values:
136136
`{{this}}` always refers to that instance, and allows you to access methods,
137137
fields, and other properties on the class instance.
138138

139-
We say that these values are _bound_ to the template in those locations. It's
140-
important to note that arguments and properties can be used interchangeably, so
141-
we could for instance have used an argument for the `sectionClass`, and a
142-
class property for title or post content:
139+
It's important to note that arguments and properties can be used
140+
interchangeably, so we could for instance have used an argument for the
141+
`sectionClass`, and a class property for title or post content:
143142

144143
```handlebars {data-filename=app/templates/components/blog-post.hbs}
145144
<h1>{{this.title}}</h1>
@@ -148,13 +147,11 @@ class property for title or post content:
148147
</section>
149148
```
150149

151-
Both arguments and properties can be used in any valid binding location. For
152-
more details on where and how you can bind values, read through the
150+
For more details on where and how you can invoke values, read through the
153151
[section on templating](../../templates/handlebars-basics/).
154-
The reason you would choose an argument or
155-
property is based on how you expect to use the component, and whether or not the
156-
value should be based on internal logic within the component, or values passed
157-
to the component where it is used.
152+
The reason you would choose an argument or property is based on how you expect
153+
to use the component, and whether or not the value should be based on internal
154+
logic within the component, or values passed to the component where it is used.
158155

159156
You can also use template helpers, modifiers, and other components within your
160157
component template:
@@ -207,7 +204,8 @@ And this will place the block - the text that is in between `<BlogPost>` and
207204
```html
208205
<h1>Fun Facts About Tomster</h1>
209206
<section class="blog-post-section">
210-
1. He's a hamster! 2. But also a Tomster!
207+
1. He's a hamster!
208+
2. But also a Tomster!
211209
</section>
212210
```
213211

@@ -255,8 +253,8 @@ or functional components, and their major difference is that they do not have an
255253
_instance_ or any instance state.
256254

257255
What this means in practice is that using properties in the template
258-
(`{{this.myProperty}}`) will result in an error. In a template-only component
259-
you can only use arguments (`{{@myArgument}}`).
256+
(e.g. `{{this.myProperty}}`) will result in an error. In a template-only component
257+
you can only use arguments (e.g. `{{@myArgument}}`).
260258

261259
Template-Only components are useful for components that don't need to have their
262260
own state, such as components that focus on presentation and formatting of data.
@@ -343,7 +341,7 @@ known as _actions_, and are decorated with the `@action` decorator.
343341
<section ...attributes class="{{this.sectionClass}}">
344342
{{yield}}
345343
346-
<button onclick={{this.likePost}} class="like-button">
344+
<button {{action this.likePost}} class="like-button">
347345
Like!
348346
</button>
349347
</section>
@@ -368,16 +366,17 @@ export default class HelloButton extends Component {
368366
```
369367

370368
Any method that you use in a template should be decorated with this decorator.
371-
It'll be covered in more detail in the section on [Actions](../actions).
369+
It'll be covered in more detail in the section on [Actions and
370+
Events](../actions-and-events).
372371

373372
#### Component Hooks and Properties
374373

375374
Components have the following class signature (this given as a TypeScript class
376375
signature for clarity and brevity, if you don't know TypeScript, don't worry!
377376
We'll explain what it all means in just a minute):
378377

379-
```ts
380-
declare class GlimmerComponent {
378+
```js
379+
class GlimmerComponent {
381380
args: object;
382381

383382
isDestroying: boolean;

guides/release/components/displaying-data.md

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)