Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2525 from willrax/deprecate-didinitattrs
Browse files Browse the repository at this point in the history
add documentation for didinitattrs deprecation
  • Loading branch information
rwjblue committed Mar 29, 2016
2 parents f44d9b7 + 101c85b commit 9f4a37c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions source/deprecations/v2.x.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,36 @@ export default Ember.Component.extend({
});
)};
```
#### Ember.Component#didInitAttrs
Using `didInitAttrs` is deprecated in favour of using `init`. When `init` is called the attrs sent in with the component will be
available after calling `this._super(...arguments)`
Given a htmlbars template like this:
```hbs
{{my-component handle="@tomdale"}}
```
Before:
```js
export default Ember.Component.extend({
didInitAttrs() {
this._super(...arguments);
this.get('handle'); // @tomdale
}
});
```
After:
```js
export default Ember.Component.extend({
init() {
this._super(...arguments);
this.get('handle'); // @tomdale
}
});
```

0 comments on commit 9f4a37c

Please sign in to comment.