diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index f7f248ea8a..cfa7712cc2 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -8,11 +8,24 @@ interface IMyResourceClass extends angular.resource.IResourceClass /////////////////////////////////////// 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' }; +}); /////////////////////////////////////// diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 4688a9c6f5..5c86370595 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -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; + withCredentials?: boolean; + responseType?: string; + interceptor?: any; } // Baseclass for everyresource with default actions.