我将角度升级到1.5,我收到此错误。这是我的控制器里面的代码
var reportURL = $rootScope.hostUrl + API_VERSION + "/runreports/" +
encodeURIComponent(scope.reportName);
reportURL += "?output-type=" +
encodeURIComponent(scope.formData.outputType) +
"&tenantIdentifier=" + $rootScope.tenantIdentifier +
"&locale=" + scope.optlang.code + "&dateFormat=" + scope.df;
var inQueryParameters = buildReportParms();
if (inQueryParameters > "") reportURL += "&" + inQueryParameters;
// Allow untrusted urls for the ajax request.
reportURL = $sce.trustAsResourceUrl(reportURL);
http.get(reportURL, {responseType: 'arraybuffer'}).
success(function(data, status, headers, config) {
var contentType = headers('Content-Type');
var file = new Blob([data], {type: contentType});
var fileContent = URL.createObjectURL(file);
// Pass the form data to the iframe as a data url.
scope.baseURL = $sce.trustAsResourceUrl(fileContent);
});
自Angular 1.4.9起,$ http服务只接受纯字符串作为URL。如果我传入一个具有toString()方法的对象,$ http会引发异常
此代码的解决方法是什么?