From 1a61d12d8d63514e1f1d3fcedf44b2384780c302 Mon Sep 17 00:00:00 2001 From: "Ciuca, Alexandru" Date: Thu, 3 Sep 2015 15:56:47 +0300 Subject: [PATCH] angular.d.ts - type safety for $controller --- angularjs/angular.d.ts | 5 +++-- bardjs/bardjs-tests.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d183167b5..dc7f5dae8 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -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; + (controllerConstructor: new (...args: any[]) => T, locals?: any, bindToController?: any): T; + (controllerConstructor: Function, locals?: any, bindToController?: any): T; + (controllerName: string, locals?: any, bindToController?: any): T; } interface IControllerProvider extends IServiceProvider { diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 71671b23e..312b06496 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -232,7 +232,7 @@ module bardTests { _default: $q.when([]) }); - controller = $controller('MyController'); + controller = $controller('MyController'); $rootScope.$apply(); }); } @@ -264,7 +264,7 @@ module bardTests { _default: $q.when([]) }); - controller = $controller('MyController'); + controller = $controller('MyController'); $rootScope.$apply(); });