Comparing version 0.4.1 to 0.4.2
@@ -13,3 +13,9 @@ "use strict"; | ||
ApiService.prototype.serialize = function (model) { | ||
return JSON.stringify(model); | ||
if (this.config.objectRoot) { | ||
return JSON.stringify((_a = {}, _a[this.config.objectRoot] = model, _a)); | ||
} | ||
else { | ||
return JSON.stringify(model); | ||
} | ||
var _a; | ||
}; | ||
@@ -56,2 +62,2 @@ ApiService.prototype.deserialize = function (data) { | ||
exports.ApiService = ApiService; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLXNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYXBpLXNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHFCQUF1QyxlQUFlLENBQUMsQ0FBQTtBQUV2RCxRQUFPLHVCQUF1QixDQUFDLENBQUE7QUFDL0IsNEJBQXlCLGVBQWUsQ0FBQyxDQUFBO0FBR3pDO0lBR0Usb0JBQXNCLElBQWEsRUFDYixJQUFZLEVBQ3RCLE1BQWdCO1FBQWhCLHNCQUFnQixHQUFoQixXQUFnQjtRQUZOLFNBQUksR0FBSixJQUFJLENBQVM7UUFDYixTQUFJLEdBQUosSUFBSSxDQUFRO1FBRWhDLElBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO0lBQ3ZCLENBQUM7SUFFRCw4QkFBUyxHQUFULFVBQVUsS0FBUTtRQUNoQixNQUFNLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUMvQixDQUFDO0lBRUQsZ0NBQVcsR0FBWCxVQUFZLElBQVM7UUFDbkIsTUFBTSxDQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFDLElBQUUsSUFBSSxHQUFHLElBQUksQ0FBQ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ZSkgPT4gdGhpcy5kZXNlcmlhbGl6ZShyZXMuanNvbigpKSk7XG4gIH1cblxuICBkZWxldGUobW9kZWw6IFQpOiBPYnNlcnZhYmxlPGJvb2xlYW4+IHtcbiAgICBsZXQgcmVxdWVzdE9wdGlvbnMgPSBuZXcgUmVxdWVzdE9wdGlvbnMoe2JvZHk6ICcnfSk7XG5cbiAgICByZXR1cm4gdGhpcy5odHRwLmRlbGV0ZShcbiAgICAgIEFwaUhlbHBlcnMuaW50ZXJwb2xhdGUoYCR7dGhpcy5wYXRofS86aWRgLCBtb2RlbCksXG4gICAgICByZXF1ZXN0T3B0aW9uc1xuICAgICkubWFwKChyZXM6IFJlc3BvbnNlKSA9PiByZXMub2spO1xuICB9XG59XG4iXX0= |
@@ -42,11 +42,2 @@ // Karma configuration | ||
options: { | ||
"declaration": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"target": "es5", | ||
}, | ||
@@ -89,2 +80,2 @@ typings: [ | ||
}) | ||
}; | ||
}; |
{ | ||
"name": "ng2-api", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Angular2 API services", | ||
@@ -13,3 +13,3 @@ "main": "dist/ng2-api.js", | ||
"test:w": "karma start --no-single-run --auto-watch", | ||
"prepublish": "npm run build && npm test" | ||
"prepublish": "npm run build" | ||
}, | ||
@@ -44,6 +44,6 @@ "keywords": [ | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.22", | ||
"karma-jasmine": "^0.3.8", | ||
"karma": "1.1.2", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-typescript-preprocessor": "0.0.21", | ||
"karma-typescript-preprocessor": "0.2.1", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
@@ -50,0 +50,0 @@ "reflect-metadata": "0.1.2", |
@@ -17,3 +17,7 @@ import {Response, RequestOptions} from '@angular/http'; | ||
serialize(model: T): string { | ||
return JSON.stringify(model); | ||
if (this.config.objectRoot) { | ||
return JSON.stringify({[this.config.objectRoot]: model}); | ||
} else { | ||
return JSON.stringify(model); | ||
} | ||
} | ||
@@ -20,0 +24,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45502
623