mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update IActionDescriptor accordingly to official documentation
This commit is contained in:
parent
3a6e1b8988
commit
45fc24faad
@ -8,11 +8,24 @@ interface IMyResourceClass extends angular.resource.IResourceClass<IMyResource>
|
||||
///////////////////////////////////////
|
||||
var actionDescriptor: angular.resource.IActionDescriptor;
|
||||
|
||||
actionDescriptor.url = '/api/test-url/'
|
||||
actionDescriptor.headers = { header: 'value' };
|
||||
actionDescriptor.isArray = true;
|
||||
actionDescriptor.method = 'method action';
|
||||
actionDescriptor.params = { key: 'value' };
|
||||
angular.injector(['ng']).invoke(function ($cacheFactory: angular.ICacheFactoryService, $timeout: angular.ITimeoutService) {
|
||||
actionDescriptor.method = 'method action';
|
||||
actionDescriptor.params = { key: 'value' };
|
||||
actionDescriptor.url = '/api/test-url/';
|
||||
actionDescriptor.isArray = true;
|
||||
actionDescriptor.transformRequest = function () { };
|
||||
actionDescriptor.transformRequest = [function () { }];
|
||||
actionDescriptor.transformResponse = function () { };
|
||||
actionDescriptor.transformResponse = [function () { }];
|
||||
actionDescriptor.headers = { header: 'value' };
|
||||
actionDescriptor.cache = true;
|
||||
actionDescriptor.cache = $cacheFactory('cacheId');
|
||||
actionDescriptor.timeout = 1000;
|
||||
actionDescriptor.timeout = $timeout(function () { });
|
||||
actionDescriptor.withCredentials = true;
|
||||
actionDescriptor.responseType = 'response type';
|
||||
actionDescriptor.interceptor = { key: 'value' };
|
||||
});
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
11
angularjs/angular-resource.d.ts
vendored
11
angularjs/angular-resource.d.ts
vendored
@ -46,11 +46,18 @@ declare module angular.resource {
|
||||
|
||||
// Just a reference to facilitate describing new actions
|
||||
interface IActionDescriptor {
|
||||
url?: string;
|
||||
method: string;
|
||||
isArray?: boolean;
|
||||
params?: any;
|
||||
url?: string;
|
||||
isArray?: boolean;
|
||||
transformRequest?: angular.IHttpResquestTransformer | angular.IHttpResquestTransformer[];
|
||||
transformResponse?: angular.IHttpResponseTransformer | angular.IHttpResponseTransformer[];
|
||||
headers?: any;
|
||||
cache?: boolean | angular.ICacheObject;
|
||||
timeout?: number | angular.IPromise<any>;
|
||||
withCredentials?: boolean;
|
||||
responseType?: string;
|
||||
interceptor?: any;
|
||||
}
|
||||
|
||||
// Baseclass for everyresource with default actions.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user