Skip to content

Instantly share code, notes, and snippets.

Working from 🇹🇼

Jared Scott gcko

Working from 🇹🇼
View GitHub Profile
gcko / sort-by.pipe.ts
Last active January 4, 2021 12:59 — forked from mdmoin7/sort-by.pipe.ts
This is a fork of that fixes the issue where the `value` will not be sorted if `caseInsensitive = false`.
View sort-by.pipe.ts
*ngFor="let c of oneDimArray | sortBy:true/false:'asc'"
*ngFor="let c of arrayOfObjects | sortBy:true/false:'asc':'propertyName'"
import { Pipe, PipeTransform } from '@angular/core';
import { orderBy, sortBy } from 'lodash-es';
@Pipe({ name: 'sortBy' })
export class SortByPipe implements PipeTransform {
gcko /
Last active February 9, 2023 18:01
Django Custom Model ForeignKey Field for Spanning Databases