Page MenuHomec4science

sort-subjects-alpha.pipe.ts
No OneTemporary

File Metadata

Created
Fri, Nov 15, 14:55

sort-subjects-alpha.pipe.ts

import { Pipe, PipeTransform } from '@angular/core';
import { DataMapping } from './models';
@Pipe({
name: 'sortSubjectsAlpha'
})
export class SortSubjectsAlphaPipe implements PipeTransform {
transform(dataMappings: DataMapping[]): DataMapping[] {
if (dataMappings.length > 0){
dataMappings.sort((a, b) =>{
return (a.subject < b.subject) ? -1 : 1;
});
}
return dataMappings;
}
}

Event Timeline