Is possible to call a function of another class?

Hi, i have a two classes, index.ts and home.ts,
if I wanted to call a function from home.ts how I can do it?

i try with @ViewChild(HomePage) homePage: HomePage;

and call homePage.ngOnInit(); but doesn’t work

Hi,

You could use events https://ionicframework.com/docs/v2/api/util/Events/

Here’s an example of the Events service.

2 Likes

Thank You for this solution :slight_smile:

Thank you for this solution. Now i will see this video!