$http example that works in IE7
HTML
<script src="http://ci.angularjs.org/view/AngularJS/job/angular.js-angular-master/ws/build/angular.min.js"></script>
<div id="ng-app" ng-app="myApp">
<div ng-controller="FetchCtrl">
<select ng-model="method">
<option>JSONP</option>
</select>
<input type="text" ng-model="url" size="80"/>
<button ng-click="fetch()">fetch</button><br>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button>
<pre>http status code: {{code}}</pre>
<pre>http response data: {{data.name || data }}</pre>
</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]).config(function($routeProvider){
//configure myApp routes
});
function FetchCtrl($scope, $http) {
$scope.method = 'JSONP';
$scope.url = 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero';
$scope.fetch = function() {
// cache set to false for IE
var httpHeaders = { 'If-Modified-Since': "0" };
$http({method: $scope.method, url: $scope.url, cache: false, headers: httpHeaders }).
success(function(data, code) {
$scope.code = code+"";
$scope.data = data;
}).
error(function(data, code) {
$scope.code = code+"";
$scope.data = data || "Request failed";
});
};
$scope.updateModel = function(method, url) {
$scope.method = method;
$scope.url = url;
};
}