Passing parameters to Angular providers in configuration phase

Providers are probably the most significant concept in Angular 1. Services and factories use providers underneath, which makes it even more powerful. Anyways, Angular 1 has two phases in it’s lifecycle, configuration phase and run phase. Providers are initialised in the configuration phase. In this phase none of other angular services, like, $http, $location and so on are available to use. I had to pass some values to a custom provider and the only way you can do it is through the config defined on the module.

I never knew you could do that and this tiny post is just a note to self as a reminder.

About andhapp

Namastey (Hello) Stranger, This is not the geekiest blog on the planet yet it is not the dumbest one either. I am a small time developer who likes to explore new technologies. I usually program in Java, Groovy and Ruby and take keen interest in the surrounding geeky developments.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>