Recently, I have been researching how to create custom services for AngularJS. However, all the examples I found demonstrate defining the service directly on my app using myApp.factory(...)
. For reference, you can check out the official docs for an example. My question is, is it possible to define a service independently from my app so that it can be easily shared across different applications? Ideally, I would like to include the .js file where the service is defined and inject it into my app without coupling it directly. Is there a way to achieve this or am I overlooking another solution?
Sincerely, Felix