title: How to handle callback for JSONP inside angularjs
body: <p>I have a working JSONP call inside a angularjs module to get working I defined the callback outside of the module (see below). I was unable to get the callback working inside the module ( callback not defined ). </p>
  
  <p>How would I get the <code>jsonp_callback(data)</code> inside the angular module ?</p>
  
  <pre><code>function jsonp_callback(data) {
  // returning from async callbacks is (generally) meaningless
  alert('good');
  console.log(data.found);
  }
  
  
  angular.module('me.services', [])
  .factory('Products', ['$http', '$q', '$filter', function ($http, $q, $filter) { // Query API and return JSON.
      return {
          get: function () {
              var _deferred = $q.defer(),
                  funds = [],
                  products = [];
  
              var murl = "http://localhost:82/api/productlist/getitems";
              $http.jsonp(murl + "?callback=jsonp_callback", null, function (result) {
                  alert('ts');
              });
        }
  </code></pre>