All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- [#106] - Update underlying project dependencies to Angular 10
- Minor types and naming changes
- [#131] - Fix expression array being reversed
- [#91] - Multiple orders with date, second item is reversed
- [#103] - Fixed date comparison in default comparator
- [#87] - fix error when expression point on sub-property of an undefined object
- [#82] - Upgrade to Angular 8
- [#79] - feature: support for callable function attribute on data source
- [#74] - Allow to sort also by function return value?
Expression now accepts string
as well as array of strings
to perform multi order.
Example, order by name
and age
:
<div *ngFor="let item of items | orderBy: ['name', 'age']">{{ item | json }}</div>
- [#52] - Value passed to transform() should not be modified.
Now the value passed to pipe is not directly modified
- [#48] - Add OrderPipe as provider in the OrderModule
Import OrderPipe
to your component:
import { OrderPipe } from "ngx-order-pipe";
Add OrderPipe
to the constructor of your component and you're ready to use it:
constructor(private orderPipe: OrderPipe) {
console.log(this.orderPipe.transform(this.collection, this.order));
}
Bundle location is changed, therefore SYSTEMJS config should be updated to
Append to map
var map = {
...
'ngx-order-pipe': 'node_modules/ngx-order-pipe/bundles'
}
and then add to packages
var packages = {
...
'ngx-order-pipe': { defaultExtension: 'js' }
}
- [#35] - Null or undefined values
- [#44] - Changing default comparator so it would properly sort null and undefined values.
- [#42] - Can't find module
- [#26] - Feature request to switch it to case-insensitive
- [#27] - Adding support for case insensitive ordering
[#28] - Fix when a or b might be null (e.g. Async items)
[#21] - Can not sort by embedded object value
[#19] - Create UMD bundle
[#15] - Change name to ngx-order-pipe
[#10] - Deep properties support
Example
<div>{{ { prop: { list: [3, 2, 1] } } | orderBy: 'prop.list' | json }}</div>
Result
<div>{ prop: { list: [1, 2, 3] } }</div>
[#11] - Sort array without expression
<div *ngFor="let i of [3, 2, 1] | orderBy">{{ i }}</div>
Result:
<div>1</div>
<div>2</div>
<div>3</div>
Angular 4
[#5] - error when using http to load data
[#2] - Add param to reverse array