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:
Brendon Colburn
2016-03-28 08:58:10 -04:00
parent 672366c6c5
commit 0aa772c53f
+5
View File
@@ -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;