我从服务中获取图片网址。我需要在另一个函数中再次发送相同的url作为参数。
Document documentInstance = Document.get(id) //get your document from somewhere
response.setContentType("APPLICATION/OCTET-STREAM")
response.setHeader("Content-Disposition", "Attachment;Filename=\"${documentInstance.filename}\"")
def outputStream = response.getOutputStream()
outputStream << documentInstance.filedata outputStream.flush()
outputStream.close() }
&#13;
<div class="modalContainer" ng-style="{'background-image': 'url(' + prefixVal + completiondetail.IDProofURL + toaken +')'}">
</div>
&#13;
我有一个保存按钮。我需要在ng-click函数saveData()中作为参数传递该图像url。我怎么发这个?
答案 0 :(得分:0)
尝试传递这样的网址,
<input type="button" name="save" ng-click="saveData(selectedMeal.url)" value="save">
在你的控制器中,
$scope.saveData = function(url){
// url = image url
}