title: Angularjs - Cleanest way to add promises to scope, now that Angular deprecated auto unwrapping of promises
body: <p>I really like the clean (and I think easy to follow) way that promises were autounwrapped:</p>
  
  <pre><code>$scope.myData = DataService.query({something:"etc"}); // done;
  </code></pre>
  
  <p>And I really don't care for what seems to be the standard way of doing it now, without the automatic unwrapping:</p>
  
  <pre><code>DataService.query({something:"etc"}).$promise.then(function (data){
      $scope.myData = data;
  });
  </code></pre>
  
  <p>What I'd like to see is something like this:</p>
  
  <pre><code>$scope.pulseData = $scope.setPromise(CitsciAnalytics.pulse({
      projId:"yardmap"
  }));
  </code></pre>
  
  <p>But I can't see how to make that happen. The closest I got was:</p>
  
  <pre><code>$scope.pulseData = $scope.setPromise("pulseData", CitsciAnalytics.pulse({
      projId:"yardmap"
  }));
  </code></pre>
  
  <p>Using a function added to the root scope:</p>
  
  <pre><code>.run(["$rootScope", "$log", function ($rootScope, $log) {
      //parent method to avoid promise unwrapping boilerplate
      $rootScope.setPromise = function (scopeVar, promise) {
          if (arguments.length === 2 &amp;&amp; promise &amp;&amp; promise.$promise) {
              var scope = this;
              promise.$promise.then(function (data){
                  scope[scopeVar] = data;
              });
          } else {
              $log.error("$rootScope.setPromise has invalid arguments");
          }
      };
  }]);
  </code></pre>
  
  <p>but I don't like the unDRY requirement of having to pass the scope variable name as an additional string. Has anyone else tackled this, or see a way to do this more cleanly?</p>