Created
June 1, 2018 14:51
-
-
Save zeppelin/2a9165df90bc130317304701620a4d58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberObject from '@ember/object'; | |
class SubclassWithEmberInit extends EmberObject { | |
someProp = 'value'; | |
init() { | |
super.init(...arguments); | |
console.log(this.someProp); // undefined | |
// `this.someProp` will be available after initialization, | |
// just not from the `init` method... | |
} | |
} | |
class SubclassWithConstructor extends EmberObject { | |
someProp = 'value'; | |
constructor() { | |
super(...arguments); | |
console.log(this.someProp); // "value" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment