Make $source public

pull/4238/head
Alex Dik 9 years ago
parent 9949636245
commit bbce930127
  1. 23
      frontend/app/components/api/api-v3/hal/hal-resource.service.ts

@ -26,6 +26,27 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
const lazy = (obj:any, property:string, callback:Function, setter:boolean = false) => {
let value;
let config = {
get() {
if (!value) {
value = callback();
}
return value;
},
set: void 0,
enumerable: true
};
if (setter) {
config.set = val => value = val;
}
Object.defineProperty(obj, property, config);
};
function halResource(halTransform, HalLink, $q) {
return class HalResource {
protected static fromLink(link) {
@ -47,7 +68,7 @@ function halResource(halTransform, HalLink, $q) {
this._name = name;
}
constructor(protected $source, public $loaded = true) {
constructor(public $source, public $loaded = true) {
this.$source = $source._plain || angular.copy($source);
this.$links = this.transformLinks();

Loading…
Cancel
Save