An example of how you can extend classes. Please check that you can change only the properties you want.
Last active
October 4, 2016 15:23
-
-
Save LudoBermejo/4a1c5f5443e21e330be57f890a9e8374 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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 Ember from 'ember'; | |
const ForceUserCharacter = Ember.Controller.extend({ | |
name: 'User of the force', | |
weapon: 'Standard lightsaber', | |
job: 'User of the Force' | |
}) | |
const AnakinCharacter = ForceUserCharacter.extend({ | |
name: 'Anakin Skywalker', | |
weapon: 'Blue lightsaber', | |
affiliation: 'Jedi' | |
}) | |
const DarthVaderCharacter = AnakinCharacter.extend({ | |
name: 'Dath Vader', | |
affiliation: 'Sith' | |
}) | |
export default Ember.Controller.extend({ | |
none: ForceUserCharacter.create(), | |
anakin: AnakinCharacter.create(), | |
darth: DarthVaderCharacter.create() | |
}); |
This file contains 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
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment