dimanche 15 mai 2016

Why assigning a property at init and didUpdateAttrs are different?

At Ember.js Guide, there is an example like that:

import Ember from 'ember';

export default Ember.Component.extend({
  init() {
    this._super(...arguments);
    this.errors = [];
  },

  didUpdateAttrs() {
    this._super(...arguments);
    this.set('errors', []);
  },

  ...
});

Why assigning to errors property is different at init and didUpdateAttrs? What are their differences?




Aucun commentaire:

Enregistrer un commentaire