title: declaring a promise in angularJS with named success/error callbacks
body: <p>I am trying to do something very similar to the $http service. From my understanding $http return a promise object.</p>
  
  <p>When using it the syntax is :</p>
  
  <pre><code>$http(...).success(function(data)) {
     //success callback
  }).error(function(data)) {
     //error callback
  })
  </code></pre>
  
  <p>I would like to do just the same but consider my API is GetUserProfile, so I wish to have the syntax :</p>
  
  <pre><code>GetUserProfile(...).success(function(data) {
     // success callback
  }).error(function(data)) {
     // error callback
  })
  </code></pre>
  
  <p>how can I accomplish that using a promise ?</p>