Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d0df8c8

Browse files
tamakisquarebtford
tamakisquare
authored andcommitted
docs(guide/filter): mention that filters can be used in directives
The doc mentions filters can be used in services and controllers but directives aren't mentioned. This could lead to confusion for beginners.
1 parent b1d1cb6 commit d0df8c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/content/guide/filter.ngdoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ E.g. the markup `{{ 1234 | number:2 }}` formats the number 1234 with 2 decimal p
2929
{@link ng.filter:number `number`} filter. The resulting value is `1,234.00`.
3030

3131

32-
## Using filters in controllers and services
32+
## Using filters in controllers, services, and directives
3333

34-
You can also use filters in controllers and services. For this, add a dependency with the name `<filterName>Filter`
35-
to your controller or service. E.g. using the dependency `numberFilter` will inject the number filter.
36-
The injected argument is a function that takes the value to format as first argument and filter parameters
37-
starting with the second argument.
34+
You can also use filters in controllers, services, and directives. For this, inject a dependency
35+
with the name `<filterName>Filter` to your controller/service/directive. E.g. using the dependency
36+
`numberFilter` will inject the number filter. The injected argument is a function that takes the
37+
value to format as first argument and filter parameters starting with the second argument.
3838

3939
The example below uses the filter called {@link ng.filter:filter `filter`}.
4040
This filter reduces arrays into sub arrays based on

0 commit comments

Comments
 (0)