Closed jcmcallister closed 3 years ago
I still have the same issue , any updates ??
Same here
To use "natural sorting", you can add this comparator (from https://stackoverflow.com/a/38641281) to your typescript file:
comparator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'}).compare;
And then use it in the template (see https://github.com/VadimDez/ngx-order-pipe#usage):
<li *ngFor="let item of array | orderBy: order : false : false : comparator">
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@VadimDez some news here?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
For strings that end in numbers, the sort seems to be incorrect. Consider the following:
Example array of strings: ["host1", "host2", "host20", "host12"] Displays: ["host1", "host12", "host2", "host20"] Expected: ["host1", "host2", "host12", "host20"]
This may be a result of the generalist transform algorithms happening in the Pipe, and may be fixable with the use of an extra comparator function during Pipe setup/consumption in my ngx component.
Figured it would be better to raise this issue overtly, in any case, due to this repo's popularity.