Last active
October 13, 2017 17:27
-
-
Save krisselden/68b73c210a1cf438f4179df7433d8269 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'; | |
class MyModel extends Ember.Object { | |
constructor() { | |
super(); | |
this._first = "Ricardo"; | |
this._last = "Mendes"; | |
} | |
get first() { | |
return this._first; | |
} | |
set first(v) { | |
this._first = v; | |
this.notifyPropertyChange('fullname'); | |
} | |
get last() { | |
return this._last; | |
} | |
set last(v) { | |
this._last = v; | |
this.notifyPropertyChange('fullname'); | |
} | |
get fullname() { | |
return this._first ? (this._last ? this._first + " " + this._last : this._first) : this._last; | |
} | |
} | |
export default class MyController extends Ember.Controller { | |
init() { | |
super.init(...arguments); | |
this.appName = 'Ember ES6 Demo'; | |
this.model = new MyModel(); | |
} | |
}; |
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.11.0", | |
"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.10.2", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.10.2", | |
"ember-testing": "2.10.2" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment