Wrapping 3rd party libraries can be a challenge when dealing with Angular directives. The four steps laid out in this article should help.
We often consider the location of execution as defining an architectural boundary. We think that code that runs in the browser is necessarily GUI code. That’s not quite true, however. Business code can run in the browser, and formatting code run on the server.
Angular has a powerful dependency injection system. Learn how to use it so that your code complies with the Dependency Inversion Principle.