mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
angular.d.ts - type safety for $controller
This commit is contained in:
Vendored
+3
-2
@@ -1230,8 +1230,9 @@ declare module angular {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IControllerService {
|
||||
// Although the documentation doesn't state this, locals are optional
|
||||
(controllerConstructor: Function, locals?: any, bindToController?: any): any;
|
||||
(controllerName: string, locals?: any, bindToController?: any): any;
|
||||
<T>(controllerConstructor: new (...args: any[]) => T, locals?: any, bindToController?: any): T;
|
||||
<T>(controllerConstructor: Function, locals?: any, bindToController?: any): T;
|
||||
<T>(controllerName: string, locals?: any, bindToController?: any): T;
|
||||
}
|
||||
|
||||
interface IControllerProvider extends IServiceProvider {
|
||||
|
||||
@@ -232,7 +232,7 @@ module bardTests {
|
||||
_default: $q.when([])
|
||||
});
|
||||
|
||||
controller = $controller('MyController');
|
||||
controller = $controller<MyController>('MyController');
|
||||
$rootScope.$apply();
|
||||
});
|
||||
}
|
||||
@@ -264,7 +264,7 @@ module bardTests {
|
||||
_default: $q.when([])
|
||||
});
|
||||
|
||||
controller = $controller('MyController');
|
||||
controller = $controller<MyController>('MyController');
|
||||
$rootScope.$apply();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user