I'm working on a SPA built with AngularJS+ng-resource that works with RestAPI built with Node.js+Express.js+Sequelize.
The problem: express.js accepts and parse queryString as Json Object. Ng-resource produces a bad queryString if you use this json object as parameters.
This is the angularJS ng-resource RestAPI call:
var queryString = {include: [{model: 'player', attributes: ['name','surname']}], where: {club: 32} };
Contract.query(queryString,
function(data) {
vm.club_players = data;
}
);
That should be produce something like this:
include[1][attributes][]:surname&
include[1][attributes][]:name&
include[1][model]:player&
where[club]:32
Actually it works if use this queryString instead the plain json object:
var queryString = {'where[id_club]': id_club, 'include[1][model]':'real_player', 'include[1][attributes][]':'id', 'include[1][attributes][]':'name', 'include[1][attributes][]':'surname'};