Skip to content

Instantly share code, notes, and snippets.

@k-fish
Created March 6, 2020 13:39
Show Gist options
  • Save k-fish/61cae1ff3e53323b7d9e80e43f1fd3a9 to your computer and use it in GitHub Desktop.
Save k-fish/61cae1ff3e53323b7d9e80e43f1fd3a9 to your computer and use it in GitHub Desktop.
Model prop undefined
import Ember from 'ember';
export default Ember.Controller.extend({
example: Ember.computed(function() {
const rec = this.store.createRecord('my-model', {
});
console.log(rec);
})
});
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
/*
import { belongsTo, hasMany } from 'ember-data/relationships';
*/
export default Model.extend({
foo: attr('string')
});
<h1>Test model prop undefined</h1>
<br>
<br>
{{example}}
<br>
<br>
{
"version": "0.16.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": "3.14.3",
"ember-template-compiler": "3.14.3",
"ember-testing": "3.14.3"
},
"addons": {
"ember-data": "3.14.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment