How to make functions shared by angular

I have two subcomponents that have several function in common

to reduce repeatability, I want to extract the common function and put it into the parent component

then load the two subcomponents

I have tried to put function on the parent component and then the child component to import the parent component is not feasible

how should I do this?

Jul.07,2022

the common function is written in service and injected directly into the component.

Menu