I want to programatically alter route parameters before $resource constructs the url. I cannot use angular's http interceptor to do this, since the route is already concatenated at that point.
Given an Assortment.model.js
module.exports = function($resource) {
return $resource("", {}, {
get: {
url: "/assortment/:model/:id",
method: "GET",
params: {id: "@id", model: "@model"} //< this needs to be uppercase
}
});
};
...and some controller.js
["Supplier", function(Supplier) {
Supplier.Assortment.get({ id: 5, model: "user" })
}]
How can I enforce a hook that will always convert {model: "user"}
to {model: "User"}