diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 26a664450f..1665bcdbe3 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1819,7 +1819,7 @@ declare module 'ember' { * The controller instance must already have been created, either through entering the * associated route or using `generateController`. */ - controllerFor(name: string): Controller; + controllerFor(name: K): ControllerRegistry[K]; /** * Disconnects a view that has been rendered into an outlet. diff --git a/types/ember/test/inject.ts b/types/ember/test/inject.ts index 5a372a2c5a..3ea0176ea6 100755 --- a/types/ember/test/inject.ts +++ b/types/ember/test/inject.ts @@ -5,6 +5,8 @@ class AuthService extends Ember.Service { } class ApplicationController extends Ember.Controller { + model: {}; + string: string; transitionToLogin() {} } @@ -29,6 +31,10 @@ class LoginRoute extends Ember.Route { this.get('application').transitionToLogin(); } } + + anyOldMethod() { + this.controllerFor('application').set('string', 'must be a string'); + } } // New module injection style.