Skip to content

Instantly share code, notes, and snippets.

@manufitoussi
Last active September 20, 2018 08:32
Show Gist options
  • Select an option

  • Save manufitoussi/9dba32465b451f67368b0868e29e7f7f to your computer and use it in GitHub Desktop.

Select an option

Save manufitoussi/9dba32465b451f67368b0868e29e7f7f to your computer and use it in GitHub Desktop.
Test Values in prototype
import Ember from 'ember';
var MyObj = Ember.Object.extend({
obj: Ember.computed({
get() {
return {
prop1: {
value: 1,
get(key) {
return 'coucou';
}
}
};
}
}).readOnly()
});
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super();
this.myObj = MyObj.create();
console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
<div>
<label>myObj.obj:</label> {{myObj.obj.prop1.value}}
</div>
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment