我按照文档示例实现了一个 fetch 方法。就我添加?format=json
到$scope.url
.
$scope.method = 'GET';
$scope.url = "/activite/273/usagers?format=json";
$scope.fetch = function($event) {
$scope.code = null;
$scope.response = null;
$http({method: $scope.method, url: $scope.url, cache: $templateCache}).
success(function(data, status) {
$scope.status = status;
$scope.users = data;
$scope.search.status = $scope.userStatus;
$('#UserList').modal('show');
}).
error(function(data, status) {
$scope.response = data || "Request failed";
$scope.status = status;
$scope.userStatus = '';
});
$event.preventDefault();
};
任何想法 ?