With the new CanJS update, my Models stopped working and I dont know why.
This is what my code looks like:
Module = can.Model.extend({
findAll: 'GET ' + window.rootPath+'api/module'
}, {});
FormModule = can.Control.extend({}, {
init: function (element, options) {
var self = this;
Module.findAll({}, function (data) {
self.element.html(can.view('viewModulesResult', data));
},
function (data) {
console.log(data);
});
}
});
Since I'm starting with javascript, I'm not very good at it, so I have no idea of whats wrong. When I pass the mouse over console.log(data) in the Console, this message appears: "Could not get any raw data while converting using .models" Does anyone knows whats wrong?