I am trying to map a list of data to my array as following:
this.data = [];
_.map(dataList, function(element){
var logic = require('./'+element+'/'+element);
var tempalte = require('text!./' + element + '/' + element + '.html');
return { Logic : logic, Template : tempalte };
});
I keep getting the following error when trying it: "Module name "..." has not been loaded yet for context: _ http://requirejs.org/docs/errors.html#notloaded"
what am i doing wrong here? is there no option to use underscore map with require?
Thanks