angular.d.ts - type safety for $controller

This commit is contained in:
Ciuca, Alexandru
2015-09-03 15:56:47 +03:00
parent 9ce3cd4ded
commit 1a61d12d8d
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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 {
+2 -2
View File
@@ -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();
});