Javascript Design Patterns: Decorator Pattern

Date: March 21, 2016

Category : code

Decorators are a structural design pattern which mostly used for adding methods to a base object without disturbing it. Decorator can be very handy when you have multiple perfectly working object which needs a new functionality.

In case of angular you will get a module type decorator which returns a $delegate with all the properties of the loaded module.

AngualarJS Docs
If you have any questions, comments or suggestions, feel free to join the discussion below!