title: How to get promise of $http API call
body: <p>I want to get <strong>promise</strong> of asynchronous call without writing any service.
  I have written <strong>some API</strong> to get data from back-end in JavaScript, but following code is not written in any <strong>service</strong>.  I want to access the following promise in another JavaScript file. How can I access the promise in different file?</p>
  
  <pre><code>  var cust_Promise = $q.defer() ;    
    var apt_data={some data};
    $http.post(api,apt_data) 
      .success(function (response,status) {      
          cust_Promise.resolve('Success');
          return cust_Promise.promise ;              
      }) ;
  </code></pre>