Angular communication between two components using subject
问题 I have two angular components and need to pass in an object from one component to another on a click. My first component has the following showEventDetails(event: Event) { this.eventsService.sendEventDetail(event) } Here Event is my custom model object: export class Event { id: number title: string description: string url: string date: string } The event service file is as follows: export class EventsService { eventDetailSubject = new Subject<any>(); constructor() { } sendEventDetail(event: