AngularJS - JSONP Simple
HTML
<div ng-app ng-controller="jsonp_example">
<button ng-click="doRequest()">Make JSONP request</button>
</div>
JavaScript
// open your console
function jsonp_callback(data) {
// returning from async callbacks is (generally) meaningless
console.log(data);
}
function jsonp_example($scope, $http) {
$scope.doRequest = function() {
var url = "http://gaurav5430.github.io/Members.json?callback=JSON_CALLBACK";
var url = "https://api.github.com/gists/5f9d75f8d6476051899d?callback=JSON_CALLBACK";
$http.jsonp(url).success(function (data) {
$scope.realTimeData = data;
console.log(JSON.parse ($scope.realTimeData.data.files['Members.json'].content) );
});
};
}