mgonto/restangular — pull request #646 by andrejpk (2014-03-24 19:31:07+00:00)
Title: Add route to setUrlToElem for ability custom IDs

The ability to override getIdFromElem isn't useful without also override
setIdToElem as well. Since setIdToElem is called from one() before the
.route value is added, adding a route parameter lets a consumer override
the setter function and use the route to build the ID. Here's an
example of how this would be used:

sr.configuration.setIdToElem = function (elem, value, route) {
route = route || elem.route;
elem[_.initial(route).join('') + "ID"] = value;
};