title: Angular UI-router resolving get promise causes post request to become null
body: <p>I have a problem with Ui-router using angular v1.3.15 and ui-router v0.2.8. I have set up routing with nested states and i am resolving promises to load views with data, so far so good. 
  My problem comes when I am resolving a promise to show previously saved "work" and trying to add new "work" via POST request i get error: "work can not be null". The strange thing is that when I do not resolve promise of GET to show prevous "work" posts my POST is working as expected (saving the data that is). </p>
  
  <p>I resolve promises to retrieve data to other views and in those views I can do PUT requests without a problem, I do not understand where I am going wrong. Allthough I am new to Angular and might be missing something really simple...</p>
  
  <p>My app.js;
  (the first state 'home.edit' gets att the current application and this is working fine, my second state is getting all the 'work', the get works fine)</p>
  
  <pre><code>  .state("home.edit",
          {
              url: "/applications/edit/:applicationId",
              templateUrl: "app/applicationEdit/applicationEdit.html",
              controller: "applicationEditCtrl as vm",
              resolve:
                  {
                  applicationEditResource: "applicationEditResource",
  
                  application: function (applicationEditResource, $stateParams)
                  {
                      var applicationId = $stateParams.applicationId;
  
                      return applicationEditResource.get(
                          { applicationId: applicationId }).$promise;
                  },
  
  
                  }
  
          })
          .state("home.edit.work", {
              url: "/Work",
              templateUrl: "app/applicationEdit/applicationEditWork.html",
              controller: "workEditCtrl as vm",
              resolve:
                  {
                      workEditResource: "workEditResource",
  
                      work: function (workEditResource) {
  
  
                          return workEditResource.get( ).$promise;
  
                      }
  
                  },
  
  
          })
  </code></pre>
  
  <p>My workEditResource;</p>
  
  <p>return $resource(appSettings.serverPath + "api/works/:applicationId", null,</p>
  
  <pre><code>      {
            'get':
           {
               isArray: true,
               method: 'GET',
               headers: { 'Authorization': 'Bearer ' + currentUser.getProfile().token }
           },
            'save': {
                method: 'POST',
                headers: { 'Authorization': 'Bearer ' + currentUser.getProfile().token }
            }
        });
  
  }
  </code></pre>
  
  <p>My workEditCtrl;</p>
  
  <pre><code>.controller("workEditCtrl",
              ["application",
                 "work",
                  "workEditResource",
                  workEditCtrl]);
  
  function workEditCtrl(application, work, workEditResource) {
      var vm = this;
      vm.fail = '';
      vm.message = '';
      vm.work = work;
      vm.application = application;
      vm.work.applicationId = vm.application.applicationId;
  
  
      if (vm.work &amp;&amp; vm.application.applicationId) {
          vm.title = "Hantera arbete " + vm.application.applicationId
      }
  
  
  
      //sparar nytt arbete med ansökans ID
      vm.submit = function () {
          vm.fail = '';
          vm.message = '';
          workEditResource.save(vm.work,
                  function(data){
                      vm.message = "Nytt arbete sparat"
                  }),
          function (response) {
  
              vm.fail = "Formuläret är inte korrekt ifyllt, var vänlig kontrollera uppgifterna och försök igen.";
          };
      }
  }
  </code></pre>
  
  <p>}());</p>
  
  <p>My API controller;</p>
  
  <pre><code> public IHttpActionResult Post([FromBody] Work work)
      {
          try
          {
              if (work == null)
              {
                  return BadRequest("Work can not be null");
              }
              if (!ModelState.IsValid)
              {
                  return BadRequest(ModelState);
              }
              var workRepository = new Models.WorkRepository();
              var newWork = workRepository.Save(work);
              if (newWork == null)
              {
                  return Conflict();
              }
              return Created&lt;Work&gt;(Request.RequestUri + newWork.WorkId.ToString(), newWork);
          }
          catch (Exception ex)
          {
              return InternalServerError(ex);
          }
  
      }
  </code></pre>
  
  <p>Would much appreciate any hints as to what I am missing :)</p>