Quantcast
Viewing all articles
Browse latest Browse all 8068

Several models of the same type inside one controller.

I'm developing an application and I need to compare 2 models of the same type inside one view.

I've tried to do something like this:

var oldModel = Alloy.createModel('Foo');
oldModel.fetch(query: { statement: { "select * from ... where timestamp = ? ", params:[oldTimestamp]}});
 
var newModel = Alloy.createModel('Foo');
newModel.fetch(query: { statement: { "select * from ... where timestamp = ? ", params:[newTimestamp]}});
//over here oldModel points to newModel
Is there a simple way of loading several models into one controller? Or should I use some hacks (open up a connection to the DB and load the model from there)?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>