Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Questions about model associations

$
0
0
Thanks for your answers guys.

What I need (at the minimum) is have access to the inverse relationship of an association. I have this fiddle based on the doc example, and would like to have task.contact return a contact object, when a contact has many tasks. But in the example below this relationship is 'undefined'.


Restating my original question: (how) can I do this with just the attributes plugin?

Subsequently, I would like to be able to specify a different name for an inverse relation (e.g. task.owner) and use polymorphism as well. Anyway, can.associate has me covered on all of this (don't know if it leaks memory or not) so I will not be creating a issue on Github (since I don't really think I have one). But I think it will greatly benefit the popularity of CanJS as a whole if associations became a first class citizen.



Viewing all articles
Browse latest Browse all 3491

Trending Articles