mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Overload for custom scope interfaces
I recently came up with this solution so I could leverage my custom scope when grabbing the scope from a controller using angular.element. It works well and with the <T extends IScope> it ensures that you can only set it to an interface that extends IScope.
This commit is contained in:
Vendored
+5
@@ -1845,6 +1845,11 @@ declare namespace angular {
|
||||
controller(name: string): any;
|
||||
injector(): any;
|
||||
scope(): IScope;
|
||||
|
||||
/**
|
||||
* Overload for custom scope interfaces
|
||||
*/
|
||||
scope<T extends IScope>(): T;
|
||||
isolateScope(): IScope;
|
||||
|
||||
inheritedData(key: string, value: any): JQuery;
|
||||
|
||||
Reference in New Issue
Block a user