I cannot seem to figure out how to get linked objects working in Orbit.js. I've read through the source code a few thousand times (not an exaggeration :D), and there is no documentation.
I've tried:
memoryStore.findLinked("student", 1, "homeworks")
but that returns the error:
Uncaught Error: OC.LinkNotFoundException: student/1/homeworks
My schema for the student looks like this:
PlanHW.models.schema.student = {
attributes: {
username: {
type: 'string'
}
//...
},
links: {
homeworks: {
type: 'hasMany',
model: 'homework',
inverse: 'student'
}
}
};
And the homework schema looks like this:
PlanHW.models.schema.homework = {
attributes: {
title: {
type: 'string'
}
//...
},
links: {
student: {
type: 'hasOne',
model: 'student',
inverse: 'homeworks'
}
}
};
How can I access the student's homeworks?
To me it looks like what you want to do is
This would give you all homeworks belonging to this student.