What type of Class Decorator to use for a non-GUI Class in Angular 2?

50 views Asked by At

I want to take advantage of Object Oriented principles and group my code into classes. However, my classes frequently have dependencies on either @angular libraries or services that I have created.

Using the new operator is out because many libraries fail without the DI framework.

What is the proper way to make a plain old class that depends on @angular libraries?

1

There are 1 answers

1
Michael Pell On

Perhaps it is safe to say that if I plan on a class depending on @angular dependencies, I should just use @Injectable() and create it as a service?