inject multiple (array) dependencies - ng

63 Views Asked by At

In angularJs i want to be able to provide multiple strategies for implementing some logic.

Example, I need to calculate interest, and there are multiple implementations (High, NoTax, None)

is there a way to inject an array of services which implement this strategy? allowing the service I inject them into to be able to select the correct strategy (or use them how it sees fit).

side note: In .NET I would make an interface which the tax stratiges implement, then I could inject an IEumerable<ITaxStrategy> into my service. Which JS cannot support.

0

There are 0 best solutions below