I want to add another function to get result from a CanJs Model
i Have something like this:
VideomakerModel = can.Model({
id:'ID',
findAll: 'GET /videomakers/',
findNear: function( params ){
return $.post("/get_near_videomakers/",
{address:params.address},
undefined ,"json")
}
},{});
VideomakerModel.findNear({address : "Milan"}, function(videomakers) {
var myList = new VideomakerControl($('#accordionVm'), {
videomakers : videomakers,
view: 'videomakersList'
});
});
If I name the method findAll it works correctly, otherwise naming it findNear it never reach the callback
should I extend MODEL is some way?? is there a way of add a function like FindAll?
thank you very much