« All deprecation guides

Deprecation Guide for Ember.Component#didInitAttrs

until: 3.0.0
since: 2.6
id: 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:

{{my-component handle="@tomdale"}}

Before:

export default Ember.Component.extend({
  didInitAttrs() {
    this._super(...arguments);
    this.get('handle'); // @tomdale
  }
});

After:

export default Ember.Component.extend({
  init() {
    this._super(...arguments);
    this.get('handle'); // @tomdale
  }
});