2
votes

Currently, in Ember-CLI an Initializer is defined like so:

// app/initializers/observation.js
export default {
  name: 'observation',
  initialize: function() {
    // code
  }
};

in this case, how would I define a sub-class of that Initializer... is the following code correct?

// app/initializers/close-observation.js
export default Ember.Observation.extend{
  newProperty: 1,
  otherProperties: 2
};
1

1 Answers

4
votes

Just import the base initializer into a variable and extend from that.

 import Observation from './observation';

 export default Observation.extend{
   newProperty: 1,
   otherProperties: 2
 };