ngx-resource-gearheart
Version:
Angular2 resource module with simple decorators. Customized by Gearheart.
18 lines (17 loc) • 572 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function SelectStorage(resource, params) {
return function (target, propertyKey) {
var nativeInit = target.ngOnInit;
target.ngOnInit = function () {
if (!!nativeInit) {
nativeInit.bind(this)();
}
var storage = resource.instance.storage;
storage._resultSubject.subscribe(function (result) {
target[propertyKey] = result;
});
};
};
}
exports.SelectStorage = SelectStorage;