You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patch method should operate like save, except it should pre-load and compute the optimal diff for saving:
vardiff=function(before,after){varpatch=after;if(angular.isArray(after)){patch=[];}elseif(angular.isObject(after)){patch={};}if(angular.isObject(before)&&angular.isDefined(after)){// Compute difference for changed propertiesangular.forEach(before,function(left,key){if(!angular.isDefined(after[key])){returnfalse;}varright=after[key];if(angular.isArray(after)||!angular.equals(left,right)||key==='id'){patch[key]=diff(left,right);}});// Add new properties to patchangular.forEach(after,function(right,key){if(!angular.isDefined(before[key])){patch[key]=right;}});}returnpatch;};
The save method should no longer pre-fetch a deep tree, and only patch should do that for calculation only, then defer to save for the actual saving.
The text was updated successfully, but these errors were encountered:
The
patch
method should operate likesave
, except it should pre-load and compute the optimal diff for saving:The
save
method should no longer pre-fetch a deep tree, and onlypatch
should do that for calculation only, then defer tosave
for the actual saving.The text was updated successfully, but these errors were encountered: