Enhancing AngularJS Logging using Decorators | Javascript | Scoop.it

Let’s explore how to use Decorators to enhance AngularJS logging and supercharge the $log service. AngularJS has a great hidden feature $provider.decorator() that allows developers to intercept services and substitute, monitor, or modify features of those intercepted services. The decorator feature is not deliberately hidden… rather it is masked by so many other great AngularJS features. In this article, I will introduce the Decorator and show how to incrementally add functionality to the $log service… with practically no changes to your custom services and controllers.