I have a service which I want to be able to configure by passing in a function for it to use. As long as this function returns something my service can use, it doesn't care how it got the data nor sync/async. Here's a sample of what I'd like to be able to do, but will not work for obvious reasons:
.config(function(MyServiceProvider, OtherService) {
MyServiceProvider.setSomeMethod( OtherService.someMethod );
})
That would be awesome, but there doesn't seem to be a way to reference "OtherService" from within the config function. I know this is because "OtherService" could potentially not yet be configured and therefore an instance of it shouldn't exist yet, but then what is a person to do in this circumstance?
In this case, is it *with angst* proper to make this association within a run block?
.run(function(MyService, OtherService) {
MyService.setSomeMethod( OtherService.someMethod );
})