Skip to content

Commit 2d4c467

Browse files
committed
Merge pull request DefinitelyTyped#4488 from johnnyreilly/master
Update angular.d.ts - JSDoc-ed $filter
2 parents 86d1044 + dfc0893 commit 2d4c467

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

angularjs/angular.d.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,17 +737,37 @@ declare module angular {
737737
eventFn(element: Node, doneFn: () => void): Function;
738738
}
739739

740-
///////////////////////////////////////////////////////////////////////////
741-
// FilterService
742-
// see http://docs.angularjs.org/api/ng.$filter
743-
// see http://docs.angularjs.org/api/ng.$filterProvider
744-
///////////////////////////////////////////////////////////////////////////
740+
/**
741+
* $filter - $filterProvider - service in module ng
742+
*
743+
* Filters are used for formatting data displayed to the user.
744+
*
745+
* see https://docs.angularjs.org/api/ng/service/$filter
746+
*/
745747
interface IFilterService {
748+
/**
749+
* Usage:
750+
* $filter(name);
751+
*
752+
* @param name Name of the filter function to retrieve
753+
*/
746754
(name: string): Function;
747755
}
748756

757+
/**
758+
* $filterProvider - $filter - provider in module ng
759+
*
760+
* Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function.
761+
*
762+
* see https://docs.angularjs.org/api/ng/provider/$filterProvider
763+
*/
749764
interface IFilterProvider extends IServiceProvider {
750-
register(name: string, filterFactory: Function): IServiceProvider;
765+
/**
766+
* register(name);
767+
*
768+
* @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx).
769+
*/
770+
register(name: string | {}): IServiceProvider;
751771
}
752772

753773
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)