mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-19 00:26:34 +08:00
Ember: actually use Controller registry in controllerFor.
This commit is contained in:
2
types/ember/index.d.ts
vendored
2
types/ember/index.d.ts
vendored
@@ -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<K extends keyof ControllerRegistry>(name: K): ControllerRegistry[K];
|
||||
|
||||
/**
|
||||
* Disconnects a view that has been rendered into an outlet.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user