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

best way to implement common Model.List

$
0
0
I have two can.Controls that need to share a common can.Model.List. I want to fetch the models once from the backend and then interact with them from either Control (loaded intermittently). I currently fetch the Models separately for each Control, but this is not a good idea for several reasons (performance, syncing)

I was hoping to use can.Model.store for this, but this holds only the models that are bound to something in the DOM (I think?), and not all my models are. What is the best way to go about this?

- defined a common can.Model.List on the application (window) that both Controls refer to?
- use the DOM to hold on to the models?
- a separate can.Control with the List?
- something else? 

I see several options but I am not sure what the smartest way is in terms of event handling, memory management, etc. Any help is appreciated.

Thanks,
Michel

Viewing all articles
Browse latest Browse all 3491

Trending Articles