Files
doneit-web/src/app/pipes/participants.pipe.ts
T
Peter Maquiran 39df5e42b7 Fix error
2021-11-03 17:03:16 +01:00

25 lines
539 B
TypeScript

import { Pipe, PipeTransform } from '@angular/core';
import { EventPerson } from 'src/app/models/eventperson.model'
@Pipe({
name: 'participants'
})
export class ParticipantsPipe implements PipeTransform {
transform(EventPerson: EventPerson[] = []): any {
let taskParticipants = [];
let taskParticipantsCc = [];
EventPerson.forEach(e =>{
if(e.IsRequired) {
taskParticipants.push(e);
} else {
taskParticipantsCc.push(e);
}
})
return {taskParticipants, taskParticipantsCc}
}
}