Answer the question
In order to leave comments, you need to log in
How to properly break functionality into files in angular?
Hello! I have several components and in some of them I need to work with an IndexedDB database. How can I correctly move the connection and other functionality (adding, deleting) records to a separate file so that I can import it into the component and already use these functions?
I understand that you can just create a directory, there is a file and write everything there, but is there any standard or special technology (standard) that allows me to do what I want?
Answer the question
In order to leave comments, you need to log in
Put the logic of work in the service and inject it into the components through the built-in DI mechanism
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question