```
###first
Gets the first element(s) of a collection.
If an expression is provided, it will only return elements whose expression is truthy.
***Usage:*** See below
```js
$scope.users = [
{ id: 1, name: { first: 'John', last: 'Wayne' } },
{ id: 2, name: { first: 'Mike', last: 'Johannson' } },
{ id: 3, name: { first: 'William', last: 'Kyle' } },
{ id: 4, name: { first: 'Rob', last: 'Thomas' } }
];
```
Returns the first user.
```html
{{ users | first }}
```
Returns the first user whose first name is 'Rob' and last name is 'Thomas'
```html
{{ users | first: 'name.first === \'Rob\' && name.last === \'Thomas\'' }}
```
Return the first two users
```html
{{ user.name.first }}
```
Return the first two users with even id
```html
{{ user.name }}
{{ users | last: 'name.last === \'bar\'' }}
{{ user.name }}
{{ user.name }}
```
###fuzzy
fuzzy string searching(approximate string matching). [Read more](http://en.wikipedia.org/wiki/Approximate_string_matching)
**note:** use fuzzyBy to filter by one property to improve performance
**Usage:** ```collection | fuzzy: search: caseSensitive[optional]```
```js
$scope.books = [
{ title: 'The DaVinci Code', author: 'F. Scott Fitzgerald' },
{ title: 'The Great Gatsby', author: 'Dan Browns' },
{ title: 'Angels & Demons', author: 'Dan Louis' },
{ title: 'The Lost Symbol', author: 'David Maine' },
{ title: 'Old Man\'s War', author: 'Rob Grant' }
];
```
```html
{{ book.title }}
{{ book.title }}
```
###fuzzyBy
fuzzy string searching(approximate string matching) by property(nested to). [Read more](http://en.wikipedia.org/wiki/Approximate_string_matching)
**Usage:** ```collection | fuzzyBy: 'property': search: caseSensitive[optional]```
```js
$scope.books = [
{ title: 'The DaVinci Code' },
{ title: 'The Great Gatsby' },
{ title: 'Angels & Demons' },
{ title: 'The Lost Symbol' },
{ title: 'Old Man\'s War' }
];
```
```html
{{ book.title }}
{{ book.title }}
```
###groupBy
Create an object composed of keys generated from the result of running each element of a collection,
each key is an array of the elements.
**Usage:** ```(key, value) in collection | groupBy: 'property'``` or ```... | groupBy: 'nested.property'```
```js
$scope.players = [
{name: 'Gene', team: 'alpha'},
{name: 'George', team: 'beta'},
{name: 'Steve', team: 'gamma'},
{name: 'Paula', team: 'beta'},
{name: 'Scruath', team: 'gamma'}
];
```
```html
Group name: {{ key }}
player: {{ player.name }}
<-- Example with fill value -->
Block: {{ block }}
```
###where
comparison for each element in a collection to the given properties object,
returning an array of all elements that have equivalent property values.
```js
$scope.collection = [
{ id: 1, name: 'foo' },
{ id: 1, name: 'bar' },
{ id: 2, name: 'baz' }
]
```
```html
```
###after
get a collection(array or object) and specified count, and returns all of the items
in the collection after the specified count.
```js
$scope.collection = [
{ name: 'foo' },
{ name: 'bar' },
{ name: 'baz' },
{ name: 'zap' },
];
```
```html
{{ col.name }}
```
###afterWhere
get a collection and properties object, and returns all of the items,
in the collection after the first that found with the given properties, including it.
```js
$scope.orders = [
{ id: 1, customer: { name: 'foo' }, date: 'Tue Jul 15 2014' },
{ id: 2, customer: { name: 'foo' }, date: 'Tue Jul 16 2014' },
{ id: 3, customer: { name: 'foo' }, date: 'Tue Jul 17 2014' },
{ id: 4, customer: { name: 'foo' }, date: 'Tue Jul 18 2014' },
{ id: 5, customer: { name: 'foo' }, date: 'Tue Jul 19 2014' }
];
```
```html
order: {{ order.id }}, {{ order.date }}
```
###before
get a collection(array or object) and specified count, and returns all of the items
in the collection before the specified count.
```js
$scope.collection = [
{ name: 'foo' },
{ name: 'bar' },
{ name: 'baz' },
{ name: 'zap' },
];
```
```html
{{ col.name }}
```
###beforeWhere
get a collection and properties object, and returns all of the items,
in the collection before the first that found with the given properties, including it.
```js
$scope.orders = [
{ id: 1, customer: { name: 'foo' }, date: 'Tue Jul 15 2014' },
{ id: 2, customer: { name: 'foo' }, date: 'Tue Jul 16 2014' },
{ id: 3, customer: { name: 'foo' }, date: 'Tue Jul 17 2014' },
{ id: 4, customer: { name: 'foo' }, date: 'Tue Jul 18 2014' },
{ id: 5, customer: { name: 'foo' }, date: 'Tue Jul 19 2014' }
];
```
```html
order: {{ order.id }}, {{ order.date }}
```
###reverse
Reverse the order of the elements in a collection
```js
$scope.users = [
{ id: 1, name: 'bazzy' },
{ id: 2, name: 'dazzy' },
{ id: 3, name: 'lazzy' }
];
```
```html
user: {{ user.id }}, {{ user.name }}
```
###isEmpty
get collection or string and return if it empty[Boolean]
```html
no content to show
```
###contains
Checks if given expression(or value) is present in one or more object in the collection
**Usage:** ```collection | contains: 'expression'```
**Aliases:** some
example 1:
```js
$scope.array = [1,2,3,4];
```
```html
```
```html
[{{i}},]
```
```html
[{{ i }},]
```
```html
[{{ i }},]
```
```js
$scope.double = function(i) {
return i * 2;
}
```
```html
[{{ i }},]
```
## String
###ucfirst
ucfirstFilter get string as parameter and return it capitalized
```html
{{ 'foo bar baz' | ucfirst }}
```
###uriEncode
get string as parameter and return encoded uri
```html
Link
```
###uriComponentEncode
get string as parameter and return encoded uri component
```html
Link
```
###slugify
Transform text into a URL slug. Replaces whitespaces, with dash("-"), or given argument
```html
LinkLink
```
###latinize
Remove accents/diacritics from a string
```html
{{ 'Sòme strÏng with Âccénts' | latinize }}
```
###startsWith
return whether string starts with the starts parameter.
usage: ```string | startsWith: 'start': case-sensitive[optional]```
```html
{{ 'Lorem ipsum' | startsWith: 'lorem' }}
{{ 'Lorem Ipsum' | startsWith: 'lorem': true }}
```
###stringular
get string with {n} and replace match with enumeration values
```html