Calling a method on a Page from a Component on that page

If I have a component that does some work getting some selections etc from the user, and I want to call a method on the parent…
If I add an input (story in my case) to the component, then on the related button click, I want to call the story’s method to do stuff…it doesn’t like my reference to the method:

this.story.addContentSearchToCriteria(this.selectedContentSearch);

I assume that by “call a method on the parent”, you mean call a method on the parent component from the child component. I generally don’t do that because it makes the child depend on the structure of the parent.

This sounds like a good case for emitting an output from the child. In your case, the output could be named “selectedContentSearach” of type ContentSearch and the button click would do this:

this.selectedContentSearch.emit(this.clickedItem);

The parent component’s instance of the child component in the template would have

selectedContentSearch triggers addContentSearchToCriteria($event)