-
-
Save taras/a859ec4a83b7c834df149dc765524457 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'; | |
export default Ember.Controller.extend({ | |
myService: Ember.inject.service('my-service'), | |
appName: 'Ember 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'; | |
function toggle() { | |
this.toggleProperty('test'); | |
} | |
class Bar { | |
get name() { | |
return 'Hello'; | |
} | |
} | |
class Foo { | |
get bar() { | |
return new Bar(); | |
} | |
} | |
let Wrapper = Ember.Object.extend({ | |
unknownProperty(key) { | |
let value = this.get(`content.${key}`); | |
if (typeof value === "object") { | |
return Wrapper.create({ content: value }); | |
} else { | |
return value; | |
} | |
} | |
}); | |
export default Ember.Service.extend({ | |
init() { | |
this._super(...arguments); | |
this.test = false; | |
this.toggleTest = toggle.bind(this); | |
this.wrapped = Wrapper.create({ | |
content: new Foo() | |
}); | |
} | |
}); |
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.14.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "2.18.2", | |
"ember-template-compiler": "2.18.2", | |
"ember-testing": "2.18.2" | |
}, | |
"addons": { | |
"ember-data": "2.18.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment