Uncaught Error Event - NativeScript + Angular


I’m trying to implement a Class that will treat errors displayed by the system and I have the following code

export class ErrorHandlingService extends ErrorHandler{


    handleError(error: any): void {

            if(error instanceof Response){
            console.log("Error: " + e);

With this Class I can, till now, treat the response types errors and the Angular ones, however I also need to treat the ones generated by Android and IOS platforms. I implemented the code following this link http://docs.nativescript.org/core-concepts/application-lifecycle#use-application-events but I can’t make it work. In witch file do I need to implement this code or what do I need to do so this code starts working properly? I’m using NativeScript + Angular.