In this article I’ll explain what a provider is and what is the difference between a provider and other services declaration in AngularJS. Through this article I’ll also create a tidy Logger for your AngularJS application.
What is wrong with $log?
Nothing! Really, $log is doing it’s work. It is a simple service for logging, including a default implementation that writes messages into the browser’s console. And that’s it. But when talking about logging, I’d like a service that will print my messages nicely, something like a timestamp and maybe a hint about where the message was created. I would also like to turn off all the messages during application configuration when running on production, and maybe expose a way to turn it on.
Your new post is loading...