You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and this is the component where I'm using this model:
export default Ember.Component.extend({
store: Ember.inject.service(),
didRender(){
let rootNode = this.get('store').peekRecord('node',1);
let rootChildren = rootNode.get('children');
console.log(rootChildren);
},
});
Every time I try that rootNode.get('children') , I get the error mentioned above.
If I go to the Ember Inspector and go to "data", select model "node" and then click on the computed property "children" I get the following erro in the console:
Object Inspector error for children Error
at Object.assert (http://localhost:4200/assets/vendor.js:24291:15)
at Object.assert (http://localhost:4200/assets/vendor.js:82122:34)
at Class._buildInternalModel (http://localhost:4200/assets/vendor.js:94483:21)
at Class._internalModelForId (http://localhost:4200/assets/vendor.js:93196:19)
at Class._pushResourceIdentifier (http://localhost:4200/assets/vendor.js:94657:17)
at Class._pushResourceIdentifiers (http://localhost:4200/assets/vendor.js:94668:33)
at ManyRelationship.updateData (http://localhost:4200/assets/vendor.js:86875:37)
at ManyRelationship.push (http://localhost:4200/assets/vendor.js:86185:12)
at Relationships.get (http://localhost:4200/assets/vendor.js:87230:22)
at Class.get (http://localhost:4200/assets/vendor.js:95149:49)
I went through a lot of docs and links but I can't get this working.
Is this a bug or am I doing anything wrong here?
Thanks very much.
The text was updated successfully, but these errors were encountered:
camarrone
changed the title
Reflexive relationship not workin
Reflexive relationship not working
Aug 30, 2017
It's not obvious from your description, but with a payload like that, you need to use the EmbeddedRecordsMixin. See this ember-twiddle for a working example with the payload you posted.
Since this is working as expected, I am closing. Please open up a new issue if you are still running into a bug, preferable with a failing test case / ember twiddle, demonstrating the issue you're having. If you have further questions, feel free to chime in at the -ember-data channel in the Ember Community Slack.
Hello,
I'm trying to set a reflexive relationship that will be used for a d3js graph (tree view) but I keep getting the following error in my component:
Assertion Failed: You can no longer pass a modelClass as the first argument to store._buildInternalModel. Pass modelName instead.
The error is raised every time I try to access the "children" in the model. My backend is returning the following payload:
this my "node" model:
this is my route:
and this is the component where I'm using this model:
Every time I try that
rootNode.get('children')
, I get the error mentioned above.If I go to the Ember Inspector and go to "data", select model "node" and then click on the computed property "children" I get the following erro in the console:
I went through a lot of docs and links but I can't get this working.
Is this a bug or am I doing anything wrong here?
Thanks very much.
The text was updated successfully, but these errors were encountered: