mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge remote-tracking branch 'upstream/master' into types2.0
This commit is contained in:
@@ -87,6 +87,15 @@ logCall = logService.warn;
|
||||
|
||||
logs = logCall.logs;
|
||||
|
||||
///////////////////////////////////////
|
||||
// ControllerService mock
|
||||
///////////////////////////////////////
|
||||
var $controller: ng.IControllerService;
|
||||
$controller(class TestController {}, {}, {myBinding: 'works!'});
|
||||
$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'});
|
||||
$controller('TestController', {}, {myBinding: 'works!'});
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// IComponentControllerService
|
||||
///////////////////////////////////////
|
||||
|
||||
12
angularjs/angular-mocks.d.ts
vendored
12
angularjs/angular-mocks.d.ts
vendored
@@ -97,6 +97,18 @@ declare namespace angular {
|
||||
logs: string[];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ControllerService mock
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$controller
|
||||
// This interface extends http://docs.angularjs.org/api/ng.$controller
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IControllerService {
|
||||
// Although the documentation doesn't state this, locals are optional
|
||||
<T>(controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T;
|
||||
<T>(controllerConstructor: Function, locals?: any, bindings?: any): T;
|
||||
<T>(controllerName: string, locals?: any, bindings?: any): T;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ComponentControllerService
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$componentController
|
||||
|
||||
@@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
|
||||
|
||||
var promise : angular.IPromise<IMyResource>;
|
||||
var arrayPromise : angular.IPromise<IMyResource[]>;
|
||||
var json: {
|
||||
[index: string]: any;
|
||||
};
|
||||
var json: IMyResource;
|
||||
|
||||
promise = resource.$delete();
|
||||
promise = resource.$delete({ key: 'value' });
|
||||
|
||||
4
angularjs/angular-resource.d.ts
vendored
4
angularjs/angular-resource.d.ts
vendored
@@ -153,9 +153,7 @@ declare namespace angular.resource {
|
||||
/** the promise of the original server interaction that created this instance. **/
|
||||
$promise : angular.IPromise<T>;
|
||||
$resolved : boolean;
|
||||
toJSON: () => {
|
||||
[index: string]: any;
|
||||
}
|
||||
toJSON(): T;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
angularjs/angularjs.d.ts
vendored
4
angularjs/angularjs.d.ts
vendored
@@ -204,7 +204,7 @@ declare namespace angular {
|
||||
* @param name The name of the constant.
|
||||
* @param value The constant value.
|
||||
*/
|
||||
constant(name: string, value: any): IModule;
|
||||
constant<T>(name: string, value: T): IModule;
|
||||
constant(object: Object): IModule;
|
||||
/**
|
||||
* The $controller service is used by Angular to create new controllers.
|
||||
@@ -294,7 +294,7 @@ declare namespace angular {
|
||||
* @param name The name of the instance.
|
||||
* @param value The value.
|
||||
*/
|
||||
value(name: string, value: any): IModule;
|
||||
value<T>(name: string, value: T): IModule;
|
||||
value(object: Object): IModule;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user