Hacker News new | ask | show | jobs
by guac 4776 days ago
How about this: http://jsfiddle.net/pJ8Mt/1/

It's a poor example since I couldn't think of anything useful off the top of my head but it shows how you might modify a service at config time by creating its provider yourself.

Also I believe .config executes immediately so the provider needs to be defined beforehand (in this case above .config, but probably better to define it in another module to ensure it's available at config time). When I defined it after .config angular complained it couldn't find awesomeProvider.