Skip to content

Commit dfc0893

Browse files
committed
Update angular.d.ts - JSDoc-ed $filter
1 parent 5e2826c commit dfc0893

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
@@ -736,17 +736,37 @@ declare module angular {
736736
eventFn(element: Node, doneFn: () => void): Function;
737737
}
738738

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

756+
/**
757+
* $filterProvider - $filter - provider in module ng
758+
*
759+
* 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.
760+
*
761+
* see https://docs.angularjs.org/api/ng/provider/$filterProvider
762+
*/
748763
interface IFilterProvider extends IServiceProvider {
749-
register(name: string, filterFactory: Function): IServiceProvider;
764+
/**
765+
* register(name);
766+
*
767+
* @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).
768+
*/
769+
register(name: string | {}): IServiceProvider;
750770
}
751771

752772
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)