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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8dabc-1174.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8dabc-1174.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?