Last active
January 8, 2018 15:27
-
-
Save chancancode/7aded3d76fcc04867b426bf05f641388 to your computer and use it in GitHub Desktop.
New Twiddle
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 Ember from 'ember'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
firstName: 'Godfrey', | |
lastName: 'Chan', | |
fullName: computed('firstName', 'lastName', function() { | |
let { firstName, lastName } = this; | |
return `${firstName} ${lastName}`; | |
}), | |
preferFirstName: true, | |
preferredName: computed('firstName', function() { | |
return this.firstName; | |
}), | |
displayName: computed('preferFirstName', 'preferredName', 'firstName', function() { | |
return this.preferFirstName ? this.firstName : this.preferredName; | |
}) | |
}); |
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
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": { | |
"ember-metal-es5-getters": true | |
} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "canary", | |
"ember-template-compiler": "canary", | |
"ember-testing": "canary" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment