Resolve using service by name as string rendering blank page


#1

Hi! I’m having trouble injecting a service declared as a string inside resolve{}. None of the other topics in this forum covering resolve issues have been any help.

The following is the current resolve{}, which renders a blank page when my testService returns either a promise or a static var:

resolve: {
      testService: 'testService',
      test: function(testService){
          console.log('hit resolve');
          return {value: 'simple!'};
       },
    }

The page will only load if I remove the service declaration and if it is not injected into the test: function().

Any ideas about where I’m going wrong here?

Thanks!


#2

you don’t need to do it this way actually, here’s how I use the UserService I have as a resolve.

resolve: {
   profile: function(User) {   
     User.me(function(res){});
   }
} 

#3

Works perfectly - just used return testService.func()

Thanks!