From 9fc7f5794ca540c5afa4dad7e191b4e7dd051c04 Mon Sep 17 00:00:00 2001 From: johnnyreilly Date: Sat, 17 Jan 2015 08:04:09 +0000 Subject: [PATCH] Let the union types go forth and multiply --- angularjs/angular-route-tests.ts | 20 ++++++++++++++------ angularjs/angular-route.d.ts | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/angularjs/angular-route-tests.ts b/angularjs/angular-route-tests.ts index 3b35a97bbc..4ca1460674 100644 --- a/angularjs/angular-route-tests.ts +++ b/angularjs/angular-route-tests.ts @@ -8,10 +8,18 @@ declare var $routeProvider: ng.route.IRouteProvider; $routeProvider - .when('/projects/:projectId/dashboard',{ - controller: '', - templateUrl: '', - caseInsensitiveMatch: true, - reloadOnSearch: false - }) + .when('/projects/:projectId/dashboard', { + controller: 'I am a string', + templateUrl: '', + caseInsensitiveMatch: true, + reloadOnSearch: false + }) + .when('/projects/:projectId/dashboard', { + controller: function() { + //Look at me - I'm a function! + }, + templateUrl: '', + caseInsensitiveMatch: true, + reloadOnSearch: false + }) .otherwise({redirectTo: '/'}); diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 949680bf2d..49df7b04be 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -42,7 +42,7 @@ declare module ng.route { * {(string|function()=} * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. */ - controller?: any; + controller?: string|Function; /** * A controller alias name. If present the controller will be published to scope under the controllerAs name. */