angular2-jsonapi
angular2-jsonapi copied to clipboard
Need change in save method
JsonApiModel.prototype.save = function (params, headers, customUrl) {
this.checkChanges();
var attributesMetadata = this[AttributeMetadataIndex];
return this.internalDatastore.saveRecord(attributesMetadata, this, params, headers, customUrl);
};
Good practice checkout arguments in function implementation, like a :
if (params instanceof HttpHeaders) {
headers = params;
params = {};
}
if (typeof headers === 'string'){
customUrl = headers;
}
Without this check need set empty object for work headers, and if only need custom url, required add all arguments...
I created simple implementation in this pull request