Place for general listeners

Hello everyone, I would like to know where/how should I put the “global” code that I want to execute all time while the app is running, for example, I have a listener that checks if the app has internet connection.

There is any general .ts file that is over all the page files? or any other common way to place that instead of copy it in every page?

Thanks, I’m very newbie :slight_smile:

Create a provider for each job category. Then you can inject the provider into a page if the page needs the information about that job.

1 Like

I created a provider with a “console.log(‘hello’);” inside, I imported and added the provider ni the app.module.ts, and imported it in my home.ts root page, but I don’t see the console.log :confused: any idea?

EDIT: Nvm i got it, was a url mistake in the import :slight_smile:

This is a good code example to study.

1 Like