I am working with Ionic 2 and have a use case where there is a home page (parent component) and inside home page there is a tab layout and in Ionic 2 each tab is a separate component (child components).
so in one tab, I am showing list of users and in home page there is also a search bar through which user can search other users. So Now when user types in search bar, a function is getting triggered which is defined in Home page (parent component) but when this function get triggered I need to raise a event in user tab (child component) in which I am going to filter the user list and display in user tab. Need help in solving this. The following is my code
<ion-content>
<ion-tabs>
//UsersTab comopnent class needs to know when getUsers function is triggered from home page
<ion-tab tabTitle="List of Users" [root]="UsersTab"></<ion-tab>
<ion-tab tabTitle="Tab 2" [root]="Tab2"></<ion-tab>
</ion-tabs>
</ion-content>
<ion-footer>
<ion-toolbar>
<ion-title>
// getUsers function will be defined is home page component class
<ion-searchbar (ionInput)="getUsers($event)"></ion-searchbar>
</ion-title>
</ion-toolbar>
</ion-footer>
I hope my question is easy to understand.