title: Getting Result of $q's Resolution or Rejection
body: <p>I'm looking at a <code>$q</code> example from <a href="http://www.packtpub.com/angularjs-web-application-development/book?tag=dp/masteringwebwithangularjs-abr1/0913" rel="nofollow">Mastering Web Application Development with Angular</a>.</p>
  
  <p>For this code, how can I retrieve the String result of <code>pizzaOrderFulfillment.resolve(...)</code> or <code>pizzaOrderFulfillment.reject</code>?</p>
  
  <pre><code>var myApp = angular.module('myApp',[]);
  
  myApp.controller("MyCtrl", function ($scope, $q) {
  
      var Person = function(name) {
  
          this.eat = function(food) {
              return name + " is eating " + food;
          };
  
          this.beHungry = function(reason) {
              return name + " is hungry because" + reason;
          };
      };
  
      // success
      var pizzaOrderFulfillment = $q.defer();
      var pizzaDelivered = pizzaOrderFulfillment.promise;
  
      var man = new Person("man");
  
      pizzaDelivered.then(man.eat, man.beHungry);
  
      pizzaOrderFulfillment.resolve("chicken");
      // TODO: var successResult = "man is eating chicken"
  });
  </code></pre>