mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Add tests for directive generics
This commit is contained in:
@@ -1545,3 +1545,23 @@ const directiveFactoryWithGeneric2: ng.IDirectiveFactory<MyScope, MyElement, MyA
|
||||
): ng.IDirectiveLinkFn<MyScope, MyElement, MyAttributes, MyController> => {
|
||||
return ($scope: MyScope, templateElement: MyElement, templateAttributes: MyAttributes, controller: MyController) => {return; };
|
||||
};
|
||||
|
||||
angular.module('WithGenerics', []).directive('usingDirectiveFactoryWithGeneric', directiveFactoryWithGeneric).directive('usingDirectiveFactoryWithGeneric2', directiveFactoryWithGeneric2);
|
||||
|
||||
class DirectiveWithGenerics implements ng.IDirective<MyScope, MyElement, MyAttributes, MyController> {
|
||||
restrict = 'EAC';
|
||||
|
||||
compile(templateElement: MyElement) {
|
||||
return {
|
||||
pre: this.link
|
||||
};
|
||||
}
|
||||
|
||||
static instance(): ng.IDirective<MyScope, MyElement, MyAttributes, MyController> {
|
||||
return new DirectiveWithGenerics();
|
||||
}
|
||||
|
||||
link($scope: MyScope, templateElement: MyElement, templateAttributes: MyAttributes, controller: MyController) {}
|
||||
}
|
||||
|
||||
angular.module('WithGenerics', []).directive('directiveWithGenerics', DirectiveWithGenerics.instance);
|
||||
|
||||
Reference in New Issue
Block a user