Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [repeat](#repeat)
- [reverse](#reverse-1)
- [slugify](#slugify)
- [latinize](#latinize)
- [startsWith](#startswith)
- [stripTags](#striptags)
- [stringular](#stringular)
Expand Down Expand Up @@ -104,7 +105,7 @@ When you're done, your setup should look similar to the following:
<!doctype html>
<html ng-app="myApp">
<head>

</head>
<body>
...
Expand Down Expand Up @@ -223,7 +224,7 @@ Return users whose first name or last name is 'John' (uses nested properties).
-->

```
Return users whose full name is
Return users whose full name is
```html
<!--search by full name -->
<th ng-repeat="user in users | filterBy: ['user.first_name + user.last_name']: 'Rob Joh'">
Expand Down Expand Up @@ -335,7 +336,7 @@ If you pass shallow, the array will only be flattened a single level<br/>
$scope.weirdArray = [[], 1, 2, 3, [4, 5, 6, [7, 8, 9, [10, 11, [12, [[[[[13], [[[[14, 15]]]]]]]]]]]]];
```
```html
<th ng-repeat="elm in wierdArray | flatten">
<th ng-repeat="elm in wierdArray | flatten">
{{ elm }},
</th>
<!--result:
Expand Down Expand Up @@ -480,7 +481,7 @@ $scope.fallback = {
```html
<li ng-repeat="order in orders | defaults: fallback">
<b>id:</b> {{ order.id }},
<b>name:</b> {{ order.name }},
<b>name:</b> {{ order.name }},
<b>shipping address:</b> {{ order.destination.zip }}
</li>
<!--Results:
Expand Down Expand Up @@ -849,16 +850,16 @@ $scope.users2 = [
<th ng-repeat="user in users1 | xor: users2">
{{ user.id }}
</th>
<!--result:
<!--result:
1 2 3 4 5
-->
<th ng-repeat="user in users1 | xor: users2: 'details.last_name'">
{{ user.id }}, {{ user.details.first_name }} {{ user.details.last_name }}
</th>
<!--result:
<!--result:
2, foo bag
```
###toArray
###toArray
Convert objects into stable arrays. <br/>
**Usage:** ```object | toArray: addKey[optional]```<br/>
if addKey set to true, the filter also attaches a new property $key to the value containing the original key that was used in the object we are iterating over to reference the property
Expand All @@ -880,7 +881,7 @@ $scope.divide = function(elm) {
<th ng-repeat="i in [1, 2, 3, 4, 5] | map: divide">
{{ i }}
</th>
<!--result:
<!--result:
0.5, 1, 1.5, 2, 2.5
```
###pluck
Expand Down Expand Up @@ -945,6 +946,17 @@ result:
<a ng-href="http://domain.com/fetch/some=string=with=spaces">Link</a>
-->
```

###latinize
Remove accents/diacritics from a string

```html
{{ 'Sòme strÏng with Âccénts' | latinize }}
<!--
result:
Some strIng with Accents
-->
```
###startsWith
return whether string starts with the starts parameter.<br/>
usage: ```string | startsWith: 'start': case-sensitive[optional]```<br/>
Expand Down Expand Up @@ -1071,8 +1083,8 @@ foo-foo-foo
#Math

###max
max find and return the largest number in a given array.
if an `expression` is provided, will return max value by expression.
max find and return the largest number in a given array.
if an `expression` is provided, will return max value by expression.
**Usage:** ```array | max: expression[optional]```
```js
$scope.users = [
Expand All @@ -1092,8 +1104,8 @@ result:
```

###min
min find and return the lowest number in a given array.
if an `expression` is provided, will return min value by expression.
min find and return the lowest number in a given array.
if an `expression` is provided, will return min value by expression.
**Usage:** ```array | min: expression[optional]```
```js
$scope.users = [
Expand Down
Loading