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 );
})
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.