wanjingy.github.io / hw8 / frontend / src / app / events-table / events-table.component.ts
events-table.component.ts
Raw
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Event } from '../event';

@Component({
  selector: 'app-events-table',
  templateUrl: './events-table.component.html',
  styleUrls: ['./events-table.component.css']
})
export class EventsTableComponent {
    @Input() events!: Event[];
    @Output() messageEventID = new EventEmitter<{id: string, venue: string}>();

    showEventDetail(eventID: string, eventVenue: string){
      this.messageEventID.emit({id: eventID, venue: eventVenue});
    }
}