不幸的是,我们被困在运行1.2.26(当它被gemified时会升级到1.2.28)。
在此期间,我该如何修补(heh)$ http,以便使用简短的patch
方法?我对整个服务/工厂/模块的事情都很陌生。我已经花了数小时的搜索,似乎无法弄清楚。
myApp.factory('patchedHTTP', function($http, BasicService) {
// $http['patch'] = function(url, data, config) {
// return $http(angular.extend(config || {}, {
// method: 'patch',
// url: url,
// data: data
// }));
// };
var extended = angular.extend(BasicService, {});
extended.createShortMethodsWithData('patch');
return extended;
});
以上是我已经得到了最好...它没有做任何事情XD
补丁已经avaible:https://code.angularjs.org/1.2.27/docs/api/ng/service/$http#patch – Fals
1.2.27不gemified但:)只是想补丁这一点点对整个事情。 – Volte