I'm using angular-cli. I have an index.html that has a script (javascript) with some global functions in it. I want to use these functions in several places in my app. I'm fairly new to Angular and typescript and I know very little about type definitions. I tried writing type definitions but I have trouble writing and/or importing them. Can someone give me an example how to do this? It would be nice if I could import all the functions with just one line.
-
What do these functions do? Couldn't you move them to an angular service and inject them on whichever classes you need?Wagner Danda da Silva Filho– Wagner Danda da Silva Filho2017-10-25 13:31:05 +00:00Commented Oct 25, 2017 at 13:31
-
I don't know many details, it is to log some actions the user does on the page.gyozo kudor– gyozo kudor2017-10-25 13:32:24 +00:00Commented Oct 25, 2017 at 13:32
-
1Ok in the end I ended up doing what @wdanda suggestedgyozo kudor– gyozo kudor2017-10-26 07:44:06 +00:00Commented Oct 26, 2017 at 7:44
Add a comment
|