Skip to content

Commit c19b042

Browse files
committed
README: Use ES6 classes and angle brackets
1 parent 9f74e95 commit c19b042

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ attribute to a tagless component, for example a tagless wrapper component:
9999

100100
```js
101101
// comment-wrapper.js
102-
export default Ember.Component({
103-
tagName: ''
104-
});
102+
export default class ComponentWrapper extends Component {
103+
tagName = '';
104+
}
105105
```
106106

107107
```hbs
108108
{{!-- comment-wrapper.hbs --}}
109109
Comment:
110-
{{comment-list-item comment=comment data-test-comment-id=data-test-comment-id}}
110+
<CommentListItem @comment={{comment}} data-test-comment-id={{data-test-comment-id}} />
111111
```
112112

113113
```handlebars
114114
{{!-- comment-list.hbs --}}
115115
{{#each comments as |comment|}}
116-
{{comment-wrapper comment=comment data-test-comment-id=comment.id}}
116+
<CommentWrapper @comment={{comment}} @data-test-comment-id={{comment.id}} />
117117
{{/each}}
118118
```
119119

@@ -122,10 +122,10 @@ component, you can specify `supportsDataTestProperties` on the class:
122122

123123
```js
124124
// comment-wrapper.js
125-
export default Ember.Component({
126-
tagName: '',
127-
supportsDataTestProperties: true
128-
});
125+
export default class ComponentWrapper extends Component {
126+
tagName = '';
127+
supportsDataTestProperties = true;
128+
}
129129
```
130130

131131
`supportsDataTestProperties`, like `data-test-*` properties, will be stripped
@@ -143,10 +143,9 @@ then pass arbitrary test selectors through splattributes, as follows:
143143

144144
```js
145145
// special-button.js
146-
export default Ember.Component({
147-
tagName: '',
148-
supportsDataTestProperties: true
149-
});
146+
export default class SpecialButton extends Component {
147+
tagName = '';
148+
}
150149
```
151150

152151
```hbs

0 commit comments

Comments
 (0)