OrderBy is a custom pipe to order arrays of any arbitrary type.
For a write up on the making of this pipe, feel free to check this out!
*ngFor="let f of fruit"
*ngFor="let f of fruit | orderBy : '{{fruitOrderByConfig}}'"
*ngFor="let f of fruit | orderBy : ['{{fruitOrderByConfig}}']"
*ngFor="let person of people"
*ngFor="let person of people | orderBy : ['{{peopleOrderByConfig[0]}}', '{{peopleOrderByConfig[1]}}']"
import {{'{'}}FuiOrderByPipeModule{{'}'}} from 'fuel-ui'; //module
import {{'{'}}OrderByPipe{{'}'}} from 'fuel-ui'; //class
OrderBy is pipe that allows for sorting ascending or descending on any array types across multiple columns. Simply pass an array of strings with the name of the key within the object. Put a '-' in front of the name if you wish to sort descending on it. OrderBy pipe also allows for data to be pushed dynamically and sorted.
*ngFor="let f of fruit | orderBy : '+'"
*ngFor="let f of fruit | orderBy : ['+']"
export class OrderByExample {{'{'}}
fruit: string[] = ["orange", "apple", "pear", "grape", "banana"];
{{'}'}}
*ngFor="let person of people | orderBy : ['-info.age', 'firstName']"