mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4509 from Bogh/master
AngularJS IResourceServiceProvider and IActionDescriptor url parameter
This commit is contained in:
@@ -8,6 +8,7 @@ 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';
|
||||
@@ -135,4 +136,11 @@ mod = mod.factory('factory name', resourceServiceFactoryFunction);
|
||||
|
||||
///////////////////////////////////////
|
||||
// IResource
|
||||
///////////////////////////////////////
|
||||
///////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// IResourceServiceProvider
|
||||
///////////////////////////////////////
|
||||
var resourceServiceProvider: angular.resource.IResourceServiceProvider;
|
||||
resourceServiceProvider.defaults.stripTrailingSlashes = false;
|
||||
|
||||
Vendored
+9
@@ -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<T>;
|
||||
<U extends IResourceClass<T>>($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 */
|
||||
|
||||
@@ -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';
|
||||
|
||||
Vendored
+1
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user