mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
93 lines
2.4 KiB
TypeScript
93 lines
2.4 KiB
TypeScript
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
|
import { EventsService } from 'src/app/services/events.service';
|
|
import { ModalController, NavController } from '@ionic/angular';
|
|
// import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
|
|
|
@Component({
|
|
selector: 'app-attendees',
|
|
templateUrl: './attendees.page.html',
|
|
styleUrls: ['./attendees.page.scss'],
|
|
})
|
|
export class AttendeesPage implements OnInit {
|
|
|
|
|
|
segment:string = "true";
|
|
shouldShowCancel:boolean = true;
|
|
|
|
searchCountryString = ''; // initialize your searchCountryString string empty
|
|
|
|
@Output() openAttendeeModal = new EventEmitter<any>();
|
|
@Output() openAddEvent = new EventEmitter<any>();
|
|
@Input() eventAttendees: EventPerson[];
|
|
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
|
|
|
|
|
constructor(private eventService: EventsService, private modalCtrl: ModalController,
|
|
private navCtrl: NavController) {
|
|
}
|
|
|
|
|
|
ngOnInit() {
|
|
}
|
|
|
|
save(){
|
|
this.GoBackEditOrAdd.emit();
|
|
//this.openAddEvent.emit();
|
|
// this.modalCtrl.dismiss(this.eventAttendees);
|
|
}
|
|
|
|
close(){
|
|
this.GoBackEditOrAdd.emit();
|
|
// this.modalCtrl.dismiss(null);
|
|
//this.openAddEvent.emit();
|
|
}
|
|
|
|
removeAttendee(attendee: EventPerson)
|
|
{
|
|
let index: number = this.eventAttendees.findIndex((att) => {
|
|
return att.EmailAddress == attendee.EmailAddress
|
|
});
|
|
|
|
this.eventAttendees.splice(index, 1);
|
|
}
|
|
|
|
async addAttendees() {
|
|
|
|
console.log('Event Intervenient');
|
|
this.openAttendeeModal.emit();
|
|
|
|
/* const modal = await this.modalCtrl.create({
|
|
component: AttendeeModalPage,
|
|
componentProps: {
|
|
eventPersons: this.eventAttendees
|
|
},
|
|
cssClass: 'attendee-modal',
|
|
backdropDismiss: false
|
|
});
|
|
|
|
await modal.present();
|
|
|
|
modal.onDidDismiss().then((data) => {
|
|
let newattendees: EventPerson[] = data['data'];
|
|
|
|
if (newattendees != null)
|
|
{
|
|
newattendees.forEach(newattendee => {
|
|
let att = {
|
|
"EmailAddress": newattendee.EmailAddress,
|
|
"Name": newattendee.Name,
|
|
"IsRequired": (this.segment == "true")
|
|
};
|
|
if (this.eventAttendees == null)
|
|
{
|
|
this.eventAttendees = new Array();
|
|
}
|
|
this.eventAttendees.push(att);
|
|
});
|
|
}
|
|
}); */
|
|
|
|
}
|
|
|
|
} |