Why is it recommended not to super
override an EmberJs model objects init
method?
I implemented this code, and it is working perfectly fine (for now, I guess):
import Ember from 'ember';
export default Ember.Object.extend({
init() {
this._super();
if (!this.get('type')) {
this.set('type', this.get('typeDefault'));
}
},
});
The EmberJs docs on init
are here
Here is one article not recommending it.
Aucun commentaire:
Enregistrer un commentaire