Ahmed Elsayed
Ahmed Elsayed

Reputation: 108

Nativescript custom functions

I create some functions and import its module, on app.component.ts file, I need to use these functions on other app components. How to do that ?

For example: I want to create custom alert message function, and use it in all other pages.

Thanks

Upvotes: 0

Views: 97

Answers (1)

PuntanetDeveloper
PuntanetDeveloper

Reputation: 318

create this function in a service so you can make the function in all your components just import the service and in app.module you have to do this

providers: [YourService],

Upvotes: 0

Related Questions