从angularjs访问RESTful api时出错

时间:2013-05-06 15:40:08

标签: rest angularjs angularjs-service

我想从RESTful API访问我的服务。我在angularJS中添加了这段代码。但它总是会失败。我不明白为什么。有帮助吗?

     $http({ method: 'GET', url: 'http://localhost:3000/profiles/someUser'}).
        success(function (data, status, headers, config) {  
            alert("success")
            $scope.items = data;
        }).
        error(function (data, status, headers, config) {
            alert("failure")
        });

我的RESTful API中有个人资料/:用户名服务

0 个答案:

没有答案