mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-27 12:21:19 +08:00
Merge pull request #2240 from JeroMiya/angularMocksInjectOverload
angular.mock.inject overload taking array DI syntax
This commit is contained in:
commit
c96231d8e4
2 files changed
+10
No files matched your search
@@ -21,6 +21,15 @@ mock.inject(
|
||||
function () { return 2; }
|
||||
);
|
||||
|
||||
mock.inject(
|
||||
['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]);
|
||||
|
||||
// This overload is not documented on the website, but flows from
|
||||
// how the injector works.
|
||||
mock.inject(
|
||||
['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }],
|
||||
['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]);
|
||||
|
||||
mock.module('module1', 'module2');
|
||||
mock.module(
|
||||
function () { return 1; },
|
||||
|
||||
Vendored
+1
@@ -30,6 +30,7 @@ declare module ng {
|
||||
|
||||
// see http://docs.angularjs.org/api/angular.mock.inject
|
||||
inject(...fns: Function[]): any;
|
||||
inject(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
|
||||
|
||||
// see http://docs.angularjs.org/api/angular.mock.module
|
||||
module(...modules: string[]): any;
|
||||
|
||||
Reference in new issue
Block a user