DEV Community

Discussion on: Angular Architecture: How to use Command Pattern to manage large amount of context menu actions

Collapse
 
humberd profile image
Maciej Sawicki

Hey, absolutely! You can inject them in the constructor, however, when we have a very large amount of actions then the constructor would be enormous and would take up the entire screen. So having only one service injected via constructor and then inline injecting the actions makes the class more readable.

Collapse
 
marekozw profile image
..

Thanks for clearing that out! I agree, code is more elegant that way.