I have the following setup
angular.module('xyz').factory('Bike', function (restmod) {
return restmod.model('/bikes').mix({
BikeParts: { hasMany: "BikeParts" },
$extend: {
Record: {
savePart: function (part) {
this.BikeParts.$create(part);
},
}
}
});
});
Now if I have a bike
with id 1 calling bike.savePart(part)
creates a POST request to /bikes/1/bike-parts
. I want instead that it posts to /bikes/1/parts/
. Is there a way to do this (without renaming the BikeParts
entry in the call to mix
)?