-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* Restful Resources service for AngularJS apps | ||
* @version v1.4.0 - 2015-04-03 * @link https://github.com/mgonto/restangular | ||
* @version v1.5.2 - 2016-02-08 * @link https://github.com/mgonto/restangular | ||
* @author Martin Gontovnikas <[email protected]> | ||
* @license MIT License, http://www.opensource.org/licenses/MIT | ||
*/(function() { | ||
|
@@ -18,7 +18,7 @@ restangular.provider('Restangular', function() { | |
*/ | ||
var safeMethods= ['get', 'head', 'options', 'trace', 'getlist']; | ||
config.isSafe = function(operation) { | ||
return _.contains(safeMethods, operation.toLowerCase()); | ||
return _.includes(safeMethods, operation.toLowerCase()); | ||
}; | ||
|
||
var absolutePattern = /^https?:\/\//i; | ||
|
@@ -395,7 +395,7 @@ restangular.provider('Restangular', function() { | |
object.setParentless = function(values) { | ||
if (_.isArray(values)) { | ||
config.shouldSaveParent = function(route) { | ||
return !_.contains(values, route); | ||
return !_.includes(values, route); | ||
}; | ||
} else if (_.isBoolean(values)) { | ||
config.shouldSaveParent = function() { | ||
|
@@ -1165,9 +1165,9 @@ restangular.provider('Restangular', function() { | |
var fullParams = response.config.params; | ||
var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred); | ||
if (elem) { | ||
|
||
var data; | ||
if (operation === 'post' && !__this[config.restangularFields.restangularCollection]) { | ||
var data = restangularizeElem( | ||
data = restangularizeElem( | ||
__this[config.restangularFields.parentResource], | ||
elem, | ||
route, | ||
|
@@ -1177,7 +1177,7 @@ restangular.provider('Restangular', function() { | |
); | ||
resolvePromise(deferred, response, data, filledObject); | ||
} else { | ||
var data = restangularizeElem( | ||
data = restangularizeElem( | ||
__this[config.restangularFields.parentResource], | ||
elem, | ||
__this[config.restangularFields.route], | ||
|
@@ -1312,7 +1312,7 @@ restangular.provider('Restangular', function() { | |
serv.getList = _.bind(collection.getList, collection); | ||
|
||
for (var prop in collection) { | ||
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.contains(knownCollectionMethods, prop)) { | ||
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.includes(knownCollectionMethods, prop)) { | ||
serv[prop] = _.bind(collection[prop], collection); | ||
} | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters