The angular Ionic child component passes data to the parent component.

I want to get the information in the subcomponent, but I don"t know why I can"t get the data

this is the subcomponent ts file
clipboard.png

clipboard.png

html

clipboard.png

Why can"t I get the data in the subcomponent


because your getData method is not triggered on your custom component, of course you can't write this method on ion-content .


it seems that there is nothing wrong with the code. In fact, you should not get data on ion-content. If you want to use child components, you can import directly in the parent component ts

.
import child from ../childCom.ts

then directly in the parent component html

<child (event)="getData($event)"></child>

it is recommended to change getData (msg:string) to getData (msg:event) or getData (msg)

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-1b340b0-2b72d.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-1b340b0-2b72d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?