How do i handle a model with another model?


#1

Hi All,

I have a API user_course will response

{course: [
    {id: xxx, type: '1'...}, 
    {id: yyy, type: '2'...}
]}

So i need to define a model user-course which inherit model ‘course’ to access the API. Actually, user course is course, so that i will push the data to course instead of user course. I use DS.RESTSERIALIZER to do that.

How do i handle the model user-course with model course? It’s mean that, when i use user-course to find an record, it will find with API user_course, then push the data to course model, and return data with course model. Creating record also as above.

Thanks !