0.1.0 • Published 10 years ago
angular-ivh-pluck-and-join v0.1.0
ivh.pluckAndJoin
An AngularJS filter to pluck and join.
Installation
Install with bower:
bower install --save angular-ivh-pluck-and-joinUsage
Add this module as a dependency to your app:
angular.module('myApp', ['ivh.pluckAndJoin']);You now have access to the ivhPluckAndJoin filter:
API
ivhPluckAndJoinFilter(Array collection, String property[, String delimiter=' ,'])
Collects property from each item in collection and returns them joined by
delimiter.
Example
<!--
scope = {
items: [
{name: 'Justin', age: 28},
{name: 'Bella', age .75}
]
}
-->
<p>{{items | ivhPluckAndJoin:'name'}}</p>
<!--
Produces:
<p>Justin, Bella</p>
You can also use a custom delimiter:
-->
<p>{{items | ivhPluckAndJoin:'name':' - '}}</p>
<!--
Produces:
<p>Justin - Bella</p>
-->Testing
Use npm test to run the full suite of linting, style checks, and unit tests.
Or, run each individually:
- Use
grunt jshintfor linting - Use
grunt jscsfor coding style checks - Use
grunt jasmineto unit tests
For ease of development the grunt watch task will run each of the above as
needed when you make changes to source files.
Changelog
2015-08-09 v0.1.0 Initial release
License
MIT
0.1.0
10 years ago
