Add attendees

This commit is contained in:
Peter Maquiran
2021-04-06 16:25:20 +01:00
parent 3ca5d0c8fe
commit affbc090d8
6 changed files with 35 additions and 23 deletions
@@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
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';
// import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
@Component({
selector: 'app-attendees',
@@ -11,12 +11,18 @@ import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
})
export class AttendeesPage implements OnInit {
eventAttendees: EventPerson[];
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) {
}
@@ -26,11 +32,15 @@ export class AttendeesPage implements OnInit {
}
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)
@@ -42,9 +52,12 @@ export class AttendeesPage implements OnInit {
this.eventAttendees.splice(index, 1);
}
async addAttendees()
{
const modal = await this.modalCtrl.create({
async addAttendees() {
console.log('Event Intervenient');
this.openAttendeeModal.emit();
/* const modal = await this.modalCtrl.create({
component: AttendeeModalPage,
componentProps: {
eventPersons: this.eventAttendees
@@ -73,7 +86,8 @@ export class AttendeesPage implements OnInit {
this.eventAttendees.push(att);
});
}
});
}); */
}
}