【发布时间】:2014-06-06 07:08:15
【问题描述】:
谁能指导我如何从asp.net webmethod获取json数据,并在angularJS中使用。
app.controller('MainController', ['$scope', function ($scope, $http) {
try {
$http({ method: 'GET', url: 'ProblemList.aspx/GetProblemList' })
.success(function (data, status, headers, config) {
alert(data); }).error(function (data, status, headers, config) {
});
} catch (e) {
throw e;
}
【问题讨论】:
-
app.controller('MainController', ['$scope', function ($scope, $http) { try { $http({ method: 'GET', url: 'ProblemList.aspx/ GetProblemList' }).success(function (data, status, headers, config) { alert(data); }).error(function (data, status, headers, config) { }); } catch (e) { throw e ; }
-
当你放置断点时它是否会命中函数,如果没有发布你的方法。
-
不,它没有达到功能
标签: asp.net angularjs webmethod