title: $modal in ui-router with service
body: <p>I have a very simple $modal feature that opens up a pop up and performs a simple get() to display information. I got the pop up working but I can't get my service to make the API call correctly.</p>
  
  <p>Here's my ui-routing page:</p>
  
  <pre><code>.state('rates.rate.runexperiment', {
      url: "/runexperiment",
      onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal){
          $modal.open({
              templateUrl: "templates/ExpsResults.html",
              controller: ['$scope', 'ExpsService', function($scope, ExpsService) {
  
                  $scope.expResults = null;
  
                  $scope.getExpResults = function(){
                      ExpsService.getExpResults('1000').get().then(function(response){
                          $scope.expResults = response;
                      });
                  };
  
                  $scope.dismiss = function() {
                      $scope.$dismiss();
                  };
  
                  $scope.getExpResults();
              }]
          }).result.then(function(){
              if (result) {
                  return $state.transitionTo('rates.rate');
              }
          });
      }]
  })
  </code></pre>
  
  <p>I tried putting the service injection in the onEnter part but to no prevail. When the user clicks on the popup button I get this in the console:</p>
  
  <pre><code>TypeError: undefined is not a function at 
  
  ExpsService.getExpResults('1000').get().then(function(response){
  </code></pre>
  
  <p>which makes me believe this controller isn't getting access to my ExpsService in my service dir (which btw works everywhere else in my angular app).</p>
  
  <p>Here's my service call I'm making using Restangular:</p>
  
  <pre><code>expResults = null,
  
  getExpResults: function(expId){
      var self=this;
      return Restangular.one('rates/exp', expId).get().then(function(response){
          self.expResults = response;
          $log.debug('getExpResults', self.self.expResults);
          return self.expResults;
      });
  },
  </code></pre>
  
  <p>Would it make sense to put my controller in it's own file and try it that way? Any opinions on how to get my factory/service call working in here?</p>