示例:angularjs 里面一个简单的 http 服务:
<script type="text/javascript"> var myApp = angular.module('myApp',[]); myApp.controller('myAppControl',['$scope','$http',function($scope,$http){ $http({ method: 'get', url: 'https://api.github.com', }).success(function (msg) { console.log(msg); }); }]); </script>