title: Angular UI-Router not passing params to service call
body: <p>First, thanks for your help in advance.  I'm a noob to angular though I did search quite a bit trying to resolve this issue. I'm guessing I missed something obvious.  I'm using ui-router and using the resolve property to call a resource and can't get it for the life of me to pass the params to the web service.</p>
  
  <p>First, my routes and states:</p>
  
  <pre><code>(function () {
      "use strict";
      var app = angular.module("MyModule",
          ["ui.router",
           "ngResource",
           "common.services"]);
      app.config(["$stateProvider", '$urlRouterProvider',
          function ($stateProvider, $urlRouterProvider) {
              $urlRouterProvider.otherwise("/");
  
              $stateProvider.state("home", {
                  url: "/",
                  templateUrl: "welcomeView.html"
              })
              $stateProvider.state("vehicleList", {
                  url: "/vehicles",
                  templateUrl: "App/Vehicles/vehicleListView.html",
                  controller: "VehicleListController as vm"
              })
              $stateProvider.state("vehicleEdit", {
                  url: "/vehicles/edit/:vin",
                  templateUrl: "App/Vehicles/vehicleEditView.html",
                  controller: "VehicleEditController as vm",
                  resolve: {
                      vehicleResource: "vehicleResource",
                      vehicle: function (vehicleResource, $stateParams) {
                          var vehicleVIN = $stateParams.vin;
                          return vehicleResource.get(
                              { vin: $stateParams.vin }).$promise;
  
                      }
                  }
              })
              $stateProvider.state("vehicleDetails", {
                  url: "/vehicles/:vin",
                  templateUrl: "App/Vehicles/vehicleDetailsView.html",
                  controller: "VehicleDetailsController as vm",
                  resolve: {
                      vehicleResource: "vehicleResource",
                      vehicle: function (vehicleResource, $stateParams) {
                          var vehicleVIN = $stateParams.vin;
                          return vehicleResource.get(
                              { vin: 'T123432342' }).$promise;
  
                      }
                  }
              })
          }
      ]);
  }());
  </code></pre>
  
  <p>Note that you see a couple of varieties of passing the vin is as I've tried numerous ways with passing in the variable vehicleVIN, a string, etc.  The vehicleVIN variable does assign properly there so injecting $stateParams or passing the vin to it doesn't seem to be the problem.</p>
  
  <p>Here is the resource:</p>
  
  <pre><code>(function () {
      "use strict";
  
      angular
          .module("common.services")
          .factory("vehicleResource",
              ["$resource",
               "appSettings",
              vehicleResource]);
  
      function vehicleResource($resource, appSettings) {
          return $resource(appSettings.serverPath + "/api/Vehicle/:vin", { vin: '@vin' },
              {
                  'update': { method: 'PUT' },
                  'details': { method: 'GET' },
                  'query': { method: 'GET', isArray = true }
              });
      }
  }());
  </code></pre>
  
  <p>Here is common.services:</p>
  
  <pre><code>(function () {
      "use strict";
  
      angular
          .module("common.services", ["ngResource"])
          .constant("appSettings",
          {
              serverPath: "http://localhost:8098"
          });
  }());
  </code></pre>
  
  <p>And here is the service end of it (Asp.Net WebAPI):</p>
  
  <pre><code>// GET api/Vehicle
  [EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All, AllowedOrderByProperties = "Name")]
  [ResponseType(typeof(IQueryable&lt;IEnumerable&lt;IVehicle&gt;&gt;))]
  public IHttpActionResult Get()
  {
      return ListOfVehicles...blah..blah
  }
  
  // GET api/Vehicle/5
  [ResponseType(typeof(IQueryable&lt;IVehicle&gt;))]
  public IHttpActionResult Get(string vin)
  {
      return SingleVehicle...blah...blah
  }
  </code></pre>
  
  <p>Every time I execute it, the breakpoint hits Get (without the vin parameter) and when I run fiddler, it looks like it's sending an empty body.</p>
  
  <p>Any ideas on what is going on?  Much appreciated!</p>