如何在函数中发送图像ng样式值

时间:2018-03-16 11:07:34

标签: javascript angularjs

我从服务中获取图片网址。我需要在另一个函数中再次发送相同的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;
&#13;
&#13;

&#13;
&#13;
<div class="modalContainer" ng-style="{'background-image': 'url(' + prefixVal + completiondetail.IDProofURL + toaken +')'}">

                
</div>
&#13;
&#13;
&#13;

我有一个保存按钮。我需要在ng-click函数saveData()中作为参数传递该图像url。我怎么发这个?

1 个答案:

答案 0 :(得分:0)

尝试传递这样的网址,

<input type="button" name="save" ng-click="saveData(selectedMeal.url)" value="save">

在你的控制器中,

$scope.saveData = function(url){
  // url = image url
}