我正在尝试将 jsreport 与 angularjs 项目集成。我可以发布 jsreport json 数据,但不知道如何处理响应以在浏览器中呈现 jsreport。任何人都可以帮助我
.controller('View1Ctrl', [ '$scope', '$http',function($scope, $http) {
var onSuccess = function (data, status, headers, config) {
$scope.data = data;
};
var onError = function (data, status, headers, config) {
$scope.error = status;
}
var datajson = {
template:{'shortid':'S1Auk01mb'},
}
var postReq = {
method: 'POST',
url: 'http://localhost:8005/api/report',
data:datajson
};
$http(postReq).success(onSuccess).error(onError);
var getReq = {
method: 'GET',
url: 'http://localhost:8005/api/report'
};
$http(getReq).success(onSuccess).error(onError);
}]);