Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91903448
sort-subjects-alpha.pipe.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 15, 14:55
Size
426 B
Mime Type
text/x-java
Expires
Sun, Nov 17, 14:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22344431
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
sort-subjects-alpha.pipe.ts
View Options
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
Log In to Comment