diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 148d40901..f7f248ea8 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -8,6 +8,7 @@ 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'; @@ -135,4 +136,11 @@ mod = mod.factory('factory name', resourceServiceFactoryFunction); /////////////////////////////////////// // IResource -/////////////////////////////////////// \ No newline at end of file +/////////////////////////////////////// + + +/////////////////////////////////////// +// IResourceServiceProvider +/////////////////////////////////////// +var resourceServiceProvider: angular.resource.IResourceServiceProvider; +resourceServiceProvider.defaults.stripTrailingSlashes = false; diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 057cc1b56..7f02a533e 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -21,6 +21,7 @@ declare module angular.resource { stripTrailingSlashes?: boolean; } + /////////////////////////////////////////////////////////////////////////// // ResourceService // see http://docs.angularjs.org/api/ngResource.$resource @@ -45,6 +46,7 @@ declare module angular.resource { // Just a reference to facilitate describing new actions interface IActionDescriptor { + url?: string; method: string; isArray?: boolean; params?: any; @@ -143,6 +145,13 @@ declare module angular.resource { ($resource: angular.resource.IResourceService): IResourceClass; >($resource: angular.resource.IResourceService): U; } + + // IResourceServiceProvider used to configure global settings + interface IResourceServiceProvider extends ng.IServiceProvider { + + defaults: IResourceOptions; + } + } /** extensions to base ng based on using angular-resource */ diff --git a/angularjs/angular-route-tests.ts b/angularjs/angular-route-tests.ts index 3607b6f13..0260359fb 100644 --- a/angularjs/angular-route-tests.ts +++ b/angularjs/angular-route-tests.ts @@ -34,3 +34,7 @@ $routeProvider }) .otherwise({ redirectTo: '/' }) .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }); + + +var current: ng.route.ICurrentRoute; +current.locals['test-key'] = 'test-value'; diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 4ddf87cab..662b2c11d 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -109,6 +109,7 @@ declare module angular.route { // see http://docs.angularjs.org/api/ng.$route#current interface ICurrentRoute extends IRoute { locals: { + [index: string]: any; $scope: IScope; $template: string; };