Skip to content

Commit 975ddc0

Browse files
committed
remove missing 'this.' deprecation
1 parent 535cf5f commit 975ddc0

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

docs/components/button.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Component from '@glimmer/component';
2+
import { tracked } from '@glimmer/tracking';
3+
import { action } from '@ember/object';
4+
5+
export default class ButtonComponent extends Component {
6+
@tracked
7+
value = 0;
8+
9+
@action
10+
incrementValue() {
11+
this.value++;
12+
}
13+
}

docs/components/button.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Also supported- block use:
1919
To add interactivity you can pass an action to `onClicked`
2020

2121
```handlebars
22-
<EsButton @onClicked={{action (mut value) (increment value)}}>
22+
<EsButton @onClicked={{this.incrementValue}}>
2323
Increment Value
2424
</EsButton>
2525
26-
{{value}}
26+
{{this.value}}
2727
```
2828

2929
## Secondary Buttons

docs/components/header.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import Component from '@glimmer/component';
2+
3+
export default class HeaderComponent extends Component {
4+
links = [
5+
{
6+
name: 'Example Links',
7+
type: 'dropdown',
8+
items: [
9+
{
10+
href: 'https://guides.emberjs.com/release/',
11+
name: 'Ember.js Guides',
12+
type: 'link',
13+
},
14+
{
15+
href: 'https://api.emberjs.com',
16+
name: 'API Reference',
17+
type: 'link',
18+
},
19+
{
20+
href: 'https://cli.emberjs.com',
21+
name: 'CLI Guides',
22+
type: 'link',
23+
},
24+
{
25+
type: 'divider',
26+
},
27+
{
28+
href: 'https://emberjs.com/learn',
29+
name: 'Learn Ember',
30+
type: 'link',
31+
},
32+
],
33+
},
34+
];
35+
}

docs/components/header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Shows the side wide header with the global navigation.
99
If you would like to override the default links you can pass a json object to update the links in the navbar.
1010

1111
```handlebars
12-
<EsHeader @links={{links}} />
12+
<EsHeader @links={{this.links}} />
1313
```
1414

1515
You can also use the block form of the component to add extra HTML to the navigation bar

tests/integration/components/es-button-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module('Integration | Component | es button', function(hooks){
3636

3737
await render(hbs`
3838
{{es-button
39-
label=label
39+
label=this.label
4040
}}
4141
`);
4242

@@ -48,7 +48,7 @@ module('Integration | Component | es button', function(hooks){
4848

4949
setProperties(this, { onClicked });
5050

51-
await render(hbs`{{es-button onClicked=onClicked}}`);
51+
await render(hbs`{{es-button onClicked=this.onClicked}}`);
5252
await click('button');
5353

5454
assert.ok(onClicked.calledOnce, 'onClicked called');

tests/integration/components/es-header-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module('Integration | Component | es header', function(hooks) {
3232

3333
test('it renders a link to a custom homepage', async function(assert) {
3434
setProperties(this, { customHomeUrl });
35-
await render(hbs`<EsHeader @home={{customHomeUrl}} />`);
35+
await render(hbs`<EsHeader @home={{this.customHomeUrl}} />`);
3636

3737
assert.dom('.navbar-brand-wrapper').hasAttribute('href', customHomeUrl);
3838
});

0 commit comments

Comments
 (0)