mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Improve module.filter() by allowing $stateful to be defined.
This commit is contained in:
@@ -214,11 +214,18 @@ mod.factory({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
});
|
||||
mod.filter('name', ($scope: ng.IScope) => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]);
|
||||
mod.filter('name', ($scope: ng.IScope) => () => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]);
|
||||
mod.filter({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
name1(foo: any) { return () => {}; },
|
||||
name2: ['foo', (foo: any) => () => {}],
|
||||
});
|
||||
const customStatefulFilter: ng.FilterFunction<(s: string) => number> = (s) => 1;
|
||||
mod.filter('name', () => customStatefulFilter);
|
||||
mod.filter('name', ['$scope', () => customStatefulFilter]);
|
||||
mod.filter({
|
||||
name1: () => customStatefulFilter,
|
||||
name2: ['foo', () => customStatefulFilter],
|
||||
});
|
||||
mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } }));
|
||||
mod.provider('name', TestProvider);
|
||||
|
||||
Reference in New Issue
Block a user