I am going to investigate this solution:
return Restangular.one('rest/parent_resource', parentId).all('child_resource').post(newChild)
in this context:
app.factory('ParentResource', function (Restangular) {
return {
getList: function() {
return Restangular.all('rest/parent_resource').getList()
}
, get: _.memoize(
function (id) {
return Restangular.one('rest/parent_resource', id).get()
})
, createChild: function(parentId, field_1, field_2) {
var newChild = {
"field_1": field_1
, "field_2": field_2
}
return Restangular.one('rest/parent_resource', parentId).all('child_resource').post(newChild)
}
}
})