MCPcopy
hub / github.com/mgonto/restangular / restangularizeCollection

Function restangularizeCollection

src/restangular.js:1057–1074  ·  view source on GitHub ↗
(parent, element, route, fromServer, reqParams)

Source from the content-addressed store, hash-verified

1055 }
1056
1057 function restangularizeCollection(parent, element, route, fromServer, reqParams) {
1058 var elem = config.onBeforeElemRestangularized(element, true, route);
1059
1060 var localElem = restangularizeBase(parent, elem, route, reqParams, fromServer);
1061 localElem[config.restangularFields.restangularCollection] = true;
1062 localElem[config.restangularFields.post] = _.bind(postFunction, localElem, null);
1063 localElem[config.restangularFields.remove] = _.bind(deleteFunction, localElem);
1064 localElem[config.restangularFields.head] = _.bind(headFunction, localElem);
1065 localElem[config.restangularFields.trace] = _.bind(traceFunction, localElem);
1066 localElem[config.restangularFields.putElement] = _.bind(putElementFunction, localElem);
1067 localElem[config.restangularFields.options] = _.bind(optionsFunction, localElem);
1068 localElem[config.restangularFields.patch] = _.bind(patchFunction, localElem);
1069 localElem[config.restangularFields.get] = _.bind(getById, localElem);
1070 localElem[config.restangularFields.getList] = _.bind(fetchFunction, localElem, null);
1071
1072 addCustomOperation(localElem);
1073 return config.transformElem(localElem, true, route, service, true);
1074 }
1075
1076 function restangularizeCollectionAndElements(parent, element, route, fromServer) {
1077 var collection = restangularizeCollection(parent, element, route, fromServer);

Callers 6

allFunction · 0.85
severalFunction · 0.85
allUrlFunction · 0.85
okCallbackFunction · 0.85

Calls 2

restangularizeBaseFunction · 0.85
addCustomOperationFunction · 0.85

Tested by

no test coverage detected