Comments (1)
I modified ngx-order.pipe.ts to handle the case sensitivity issue for sorting string:
private sortArray(value: any[], expression?: any, reverse?: boolean): any[] {
const isDeepLink = expression && expression.indexOf('.') !== -1;
if (isDeepLink) {
expression = OrderPipe.parseExpression(expression);
}
let array: any[] = value.sort((a: any, b: any): number => {
if (!expression) {
return a > b ? 1 : -1;
}
if (!isDeepLink) {
let aVal = a[expression], bVal = b[expression];
if (typeof aVal === 'string') {
aVal = aVal.toLowerCase();
}
if (typeof bVal === 'string') {
bVal = bVal.toLowerCase();
}
return aVal > bVal ? 1 : -1;
}
return OrderPipe.getValue(a, expression) > OrderPipe.getValue(b, expression) ? 1 : -1;
});
if (reverse) {
return array.reverse();
}
return array;
}
from ngx-order-pipe.
Related Issues (20)
- Error ordering by null date propertie
- i have this error : ERROR Error: Uncaught (in promise): Error: The pipe 'async' could not be found! HOT 1
- Build Error after Latest Update HOT 7
- Sort in descending order with null values HOT 1
- Use Generics instead of any HOT 9
- Get sorted array from pipe to component. HOT 1
- ERROR NullInjectorError: R3InjectorError(AppModule)[OrderPipe -> OrderPipe -> OrderPipe]: HOT 1
- Turn into a standalone pipe HOT 3
- Create Ivy build HOT 15
- .
- not compatible with Angular Ivy HOT 1
- I want order by data by filed with mutiple value HOT 4
- Custom comparator not working - ordering date HOT 3
- skip collection argument, sort by object itself HOT 2
- Multiple orders with date, second item is reversed HOT 2
- The pipe 'orderBy' could not be found HOT 1
- How i can apply sorting only on header click ? HOT 1
- Error when using ngx-pipes with ngx-order-pipe (both packages contain orderBy pipe) HOT 1
- Angular v9 support HOT 1
- Multi ordering is not working for the build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-order-pipe.