[frontend] Add twitter-corpses pipe

This commit is contained in:
Cathy Hu 2020-09-01 20:28:59 +02:00
parent 444b38e0e5
commit 5cf06a647f
2 changed files with 12 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import { TelegramInfoDialogComponent } from './telegram/telegram-info-dialog/tel
import { TelegramDialogComponent } from './telegram/telegram-dialog/telegram-dialog.component'; import { TelegramDialogComponent } from './telegram/telegram-dialog/telegram-dialog.component';
import { TwitterInfoDialogComponent } from './twitter/twitter-info-dialog/twitter-info-dialog.component'; import { TwitterInfoDialogComponent } from './twitter/twitter-info-dialog/twitter-info-dialog.component';
import { TwitterCallbackComponent } from './twitter/twitter-callback/twitter-callback.component'; import { TwitterCallbackComponent } from './twitter/twitter-callback/twitter-callback.component';
import { TwitterCorpsesPipe } from './twitter/twitter-corpses-pipe/twitter-corpses.pipe';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -22,6 +23,7 @@ import { TwitterCallbackComponent } from './twitter/twitter-callback/twitter-cal
TelegramDialogComponent, TelegramDialogComponent,
TwitterInfoDialogComponent, TwitterInfoDialogComponent,
TwitterCallbackComponent, TwitterCallbackComponent,
TwitterCorpsesPipe,
], ],
imports: [CommonModule, SharedModule], imports: [CommonModule, SharedModule],
exports: [ exports: [

View file

@ -0,0 +1,10 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'twitterCorpses',
})
export class TwitterCorpsesPipe implements PipeTransform {
transform(twitters) {
return twitters.filter((x) => x.verified === 1);
}
}