Where to setup Application Events handling



I am trying to setup application events handling, Since I am new I am not sure where exactly should that go?

I would imagine this to be in the app.component.ts (root module)


What you mean by application event handling, can you give an example.

Although you have tagged nativescriptcore but in post you also mentioned app.component.ts (root module) which is related to Angular. Please clarify exactly what you are using for development & what you are looking for.


I tagged nativescript core because application lifecycle is seemed like a core feature. Sorry for the confusion. I am trying to find a central place where I can handle all nativescript application events

I should be able to
Catch application level exceptions
Handle events like, suspend, resume etc.

I am hope that gives an Idea about what am I trying to find.
thanks :slight_smile:


You could do that in a separate TS file and just include that in both main.ts and main.aot.ts Or even app component.