title: Angular - Service returns value, but doesn't route in app.config
body: <p>I want to make a call to a service to retrieve a user from a database (currently mock data, but it will be from a database) and have that user's information sent to ProfileController when the "profile" state is activated. The call is made to the service, but nothing happens after that: no action is made in the <code>then()</code> or <code>catch()</code> portion of the function. Any ideas on what I should do?</p>
  
  <pre><code>(function() {
    "use strict";
  
    angular.module("testing_app", [
      "ui.router"
    ])
    .config(function($urlRouterProvider, $locationProvider, $stateProvider, $qProvider) {
      $locationProvider.html5Mode(true);
  
      $stateProvider
          .state("users", {
              url: "/users",
              templateUrl: "templates/users.html",
              controller: "UsersController as uc"
          })
        .state("profile", {
          url: "/user/:id",
          templateUrl: "templates/profile.html",
          controller: "ProfileController as pc",
          resolve: {
            resolvedUser: ["UsersService", "$q", "$stateParams", function(UsersService, $q, $stateParams){
              console.log($stateParams.id);
              return UsersService.findById($stateParams.id).then(function(user){
                return user;
              }).catch(function(error){
                return $q.reject(error);
              });
            }]
          }
        });
    });
  })();
  </code></pre>
  
  <p>UsersService.js is currently using mock data, but it will eventually get data from a database.</p>
  
  <pre><code>(function(){
      "use strict";
  
      angular.module("testing_app")
          .factory("UsersService", function(){
  
              var Users = {};
  
              var userList = [
                  { id: 1, name: "Richard Hendricks", email: "richard@piedpiper.com", phone: 4085550011, pokemon: { isPresent: true, name: "eevee"}, icon: { isPresent: false, name: null} },
                  { id: 2, name: "Erlich Bachman", email: "erlich@aviato.com", phone: 4155552233, pokemon: { isPresent: true, name: "celebi"}, icon: { isPresent: false, name: null} },
                  { id: 3, name: "Gavin Belson", email: "gavin@hooli.com", phone: 9165554455, pokemon: { isPresent: true, name: "snorlax"}, icon: { isPresent: false, name: null} }
              ];
  
              Users.all = function(){
                  return userList;
              };
  
              Users.findById = function(id){
                  return userList.find(function(user){
                      return user.id == id;
                  });
              };
  
              return Users;
          });
  })();
  </code></pre>