Skip to content

Commit d96807b

Browse files
author
eliorb
committed
feat(joinFilter): update README
1 parent 982f460 commit d96807b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
- [fuzzyBy](#fuzzyby)
2727
- [groupBy](#groupby)
2828
- [isEmpty](#isempty)
29+
- [join] (#join)
2930
- [last](#last)
3031
- [map](#map)
3132
- [omit](#omit)
@@ -341,6 +342,25 @@ $scope.weirdArray = [[], 1, 2, 3, [4, 5, 6, [7, 8, 9, [10, 11, [12, [[[[[13], [[
341342
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
342343
```
343344
345+
### join
346+
Joins the contents of a collection into a string.<br/>
347+
By default, it will join elements with a *single space*, but you can provide your own delimiter.
348+
349+
**Usage:** ```collection | join:', '```
350+
351+
Example:
352+
353+
```js
354+
$scope.names = ['John', 'Sebastian', 'Will', 'James'];
355+
```
356+
357+
```html
358+
<p>{{ names | join:', ' }}</p>
359+
<!-- Will print "John, Sebastian, Will, James" -->
360+
361+
```
362+
363+
344364
###fuzzy
345365
fuzzy string searching(approximate string matching). [Read more](http://en.wikipedia.org/wiki/Approximate_string_matching)<br/>
346366
**note:** use fuzzyBy to filter by one property to improve performance<br/>

src/filters.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ angular.module('angular.filter', [
5050
'a8m.first',
5151
'a8m.last',
5252
'a8m.flatten',
53+
'a8m.join',
5354

5455
'a8m.math',
5556
'a8m.math.max',

0 commit comments

Comments
 (0)