I have the following piece of code that fetches data from a server...
dataCollection.fetch();
The data returned is a list of objects...
evidenceCollection.fetch().done(function(data)
{
console.log(data) //['test', 'test2']
});
I need this data to create a view...
var test_vw = new View({
name: getName(),
data: evidenceCollection.fetch().done(function(data) { return data })
});
This will not work as it throws errors. I also have the same error when I try to save data
to a variable. What is the proper way to achieve what this?