Greetings, I am writing on angular 2 and I cannot figure out how to organize the connection to соккетам in a separate service, so that I can work with its methods in different classes.
The problem is that when creating a service and importing more than once in a project, соккеты connected as many times as there were imports for the project.
Perelazilil all Internet, there are only connection examples that do not solve the problem of multi-import project.
Thanks to everyone who responded.