Skip to content

Commit 2aa3339

Browse files
chriskrychoijlee2
andauthored
Fix backing class in Template Lifecycle, DOM, and Modifiers (#1751)
* Fix backing class in Template Lifecycle, DOM, and Modifiers The previous version of this example was lacking the imports and used a bare class instead of one which `extends Component`, and also did not include the `@action` binding, so would simply not have worked. * Update guides/release/components/template-lifecycle-dom-and-modifiers.md Co-authored-by: Isaac Lee <16869656+ijlee2@users.noreply.github.com>
1 parent 1cadf19 commit 2aa3339

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

guides/release/components/template-lifecycle-dom-and-modifiers.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ The simplest way to accomplish this is by using the `did-insert` modifier from [
266266
```
267267

268268
```js {app/components/edit-form.js}
269-
export default class EditForm {
269+
import Component from '@glimmer/component';
270+
import { action } from '@ember/object';
271+
272+
export default class EditFormComponent extends Component {
273+
@action
270274
focus(element) {
271275
element.focus();
272276
}

0 commit comments

Comments
 (0)