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}
  }

}
