0

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);
}]);
4

1 に答える 1