How can i track every error in app.component.ts in ionic

I am using ionic 2.i want to track every error that occur in ionic 2 app.component.ts file .Is there any solution for this ?

thanks in advance

What do you mean by “track”?
How do you define “error”?

I have to track every error that occur in app irrespective of page and component in app.componet.ts file .will it possible.Actually we can create global error class that can use in every page .but instead of that no re written code can it possible?

I reckon you need IonicErrorHandler or you can even write your own custom one

See ionic error handler here

You still didn’t say what exactly you mean by “track”. Write to a cloud service? Into a log file? Send a post card?
Note that native Cordova apps can also crash, which is 100% outside of the realm of Ionic so can’t be tracked from the inside. You will have to use an error tracking service for that.