我从forrest api检索数据时遇到意外的数字错误

时间:2016-03-06 00:02:04

标签: javascript angularjs

var app=angular.module('ssbank',['ngResource']);

以下代码用于启用跨源请求

app.config(['$httpProvider', function($httpProvider) {
   $httpProvider.defaults.useXDomain = true;
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
}
]);

app.controller('bankcontroller',function($scope,$http,$resource){
    var user=$resource("http://localhost:9080/RestService/hello");
    $scope.data=user.get();
});

i'm able retrieve the data from rest service successfully   `

0 个答案:

没有答案