Skip to content

Latest commit

 

History

History
107 lines (71 loc) · 1.42 KB

aggregate.md

File metadata and controls

107 lines (71 loc) · 1.42 KB

Aggregate

You can check the module import here.

####groupBy

Returns the groupped data of the given array.

File
import { GroupByPipe } from 'angular-pipes/src/aggregate/group-by.pipe';
Usage
const values = [
    { name: 'a', prop: 'foo' },
    { name: 'b', prop: 'bar' },
    { name: 'c', prop: 'bar' },
    { name: 'd', prop: 'foo' }
]
{{ values | groupBy: 'prop' }}
<!--
	[
		{key: foo, value: Array[2]},
		{key: bar, value: Array[2]}
	]
-->

####min

Returns the minimum of the given array.

File
import { MinPipe } from 'angular-pipes/src/aggregate/min.pipe';
Usage
{{ [5, 4, 1, 9] | min }} <!-- 1 -->

####max

Returns the maximum of the given array.

File
import { MaxPipe } from 'angular-pipes/src/aggregate/max.pipe';
Usage
{{ [5, 4, 1, 9] | max }} <!-- 9 -->

####mean

Returns the mean of the given array.

File
import { MeanPipe } from 'angular-pipes/src/aggregate/mean.pipe';
Usage
{{ [5, 5, 1, 9] | mean }} <!-- 5 -->

####sum

Returns the sum of the given array.

File
import { SumPipe } from 'angular-pipes/src/aggregate/sum.pipe';
Usage
{{ [5, 5, 1, 9] | sum }} <!-- 20 -->