Add $plain property to Restangular results

pull/4159/head
Alex Dik 9 years ago
parent bb523bd505
commit 3e14fbab2c
  1. 2
      frontend/app/components/api/api-v3/api-v3.config.ts
  2. 2
      frontend/app/components/api/api-v3/hal/hal-resource.service.ts

@ -28,6 +28,8 @@
function apiV3Config(apiV3, halTransform) {
apiV3.addResponseInterceptor((data, operation, what) => {
data.$plain = angular.copy(data);
apiV3.addElementTransformer(what, halTransform);
if (data && data._type === 'Collection') {

@ -47,7 +47,7 @@ function halResource(halTransform, HalLink, $q) {
}
constructor(protected $source, public $loaded = true) {
var source = $source.restangularized ? $source.plain() : angular.copy($source);
var source = angular.copy($source.restangularized ? $source.$plain : $source);
this.$links = this.transformLinks();
this.$embedded = this.transformEmbedded();

Loading…
Cancel
Save