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

Commit e37e30e

Browse files
pkozlowski-opensourcebtford
authored andcommitted
docs(orderBy): clarify expression usage in a predicate
Closes #8592
1 parent a0b8ab8 commit e37e30e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ng/filter/orderBy.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818
*
1919
* - `function`: Getter function. The result of this function will be sorted using the
2020
* `<`, `=`, `>` operator.
21-
* - `string`: An Angular expression which evaluates to an object to order by, such as 'name'
22-
* to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control
23-
* ascending or descending sort order (for example, +name or -name).
21+
* - `string`: An Angular expression. The result of this expression is used to compare elements
22+
* (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by
23+
* 3 first characters of a property called `name`). The result of a constant expression
24+
* is interpreted as a property name to be used in comparisons (for example `"special name"`
25+
* to sort object by the value of their `special name` property). An expression can be
26+
* optionally prefixed with `+` or `-` to control ascending or descending sort order
27+
* (for example, `+name` or `-name`).
2428
* - `Array`: An array of function or string predicates. The first predicate in the array
2529
* is used for sorting, but when two items are equivalent, the next predicate is used.
2630
*

0 commit comments

Comments
 (0)