Our data is structured to have a parent resource with multiple child resources. In the child component, which is mapped to one of those child resources, when a form is submitted (PUT), that child resource is refreshed afterward.
In one specific case, when that PUT request is successful, it triggers changes to the parent resource on the server, and requires the parent component to refresh its resource.
Currently, I've created an event emitter/output on the child component named
update. And when the conditions are met that require the parent to refresh, we run
The parent, meanwhile, plugs into the child component's output via the HTML in the parent component template:
<child-component [resource]="childResource" (update)="refreshParentResource()" />
My concern is that the event being emitted is not an update, per se. It's more of a request for the parent to refresh, but I don't feel any better about an event emitter like
this.requestFullRefresh.emit() in the child component. Perhaps an event emitter is not the way to go? But how do I otherwise communicate the need for a refresh FROM the child component TO the parent component?