I have one parent containing two child components.
AppComponent
NotificationsComponent
MoveCopyComponent
I want to emit values of MoveCopyComponent to NotificationComponent. Whenever I emit i get a property undefined in the NotificationComponent as shown in the screenshot
<notifications #notificationsMenu role="menuitem" dropdown-item
[caller]="'menu'"
(acceptShareFromMenuEvent)="shareAcceptModal.PinItem($event)"
(contentShareAccepted)="shareAcceptModal.hide()">
</notifications>
And down below we have declared a component which pops a modal to place the content.
<movecopy-item #shareAcceptModal
(shareAcceptedandPlaced) = "notificationItem.contentAccepted($event)">
</movecopy-item>
A button click in the modal(movecopy component) shareAcceptedandPlaced event is triggered by which I need to execute contentAccepted(..) method in my notifications component as below.
shareAcceptedandPlaced(){
this.shareAcceptedandPlaced.emit(this.sharedItemPinnedInfo);
}
What is happening here is that the notifications component contains the collection of the incoming components while the move-CopyItem is merely a selection component to place the incoming component.
When the #shareAcceptModal raises the "(shareAcceptandPlaced)" event for the "notificationItem's" contentAccepted() method, I get the following exception: "Cannot call contentAccepted on undefined. as in the above screenshot"
What am I doing wrong here?