Where to setup Application Events handling

nativescriptcore

#1

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)


#2

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.


#3

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
https://docs.nativescript.org/core-concepts/application-lifecycle#use-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:


#4

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.