I am using the Angular Material CDK Overlay to show some options once an HTML element is clicked and I cannot figure out how to get the buttons to trigger a click event. Is there a way to do this?
I need to know which button was clicked and I cannot find a way. Clicking everywhere else works - outside of the overlay closes and inside the overlay triggers a click but not the buttons. Nothing happens on click of the buttons.
this._overlayRef = this.overlayService.createPopover(
cellId,
checkOutElement,
[
{
offsetX: -145,
offsetY: -20,
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'bottom'
},
{
offsetX: -145,
offsetY: 20,
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'top'
}
]
);
let moreInfoPortal = new ComponentPortal(PopoverComponent, this.vcr)
const poppoverRef = this._overlayRef.attach(moreInfoPortal);
const data = {
item,
checkIn,
checkOut
}
poppoverRef.instance.data = data;
Any help is much appreciated!