我需要在每个缩略图下面插入文本框。我把它和天使一起用。
我已经添加了删除链接,点击调用API从服务器删除文件。但是如果我要添加文本框,我需要发送所有的文本框值,点击某个按钮,我需要发送所有缩略图的文本框值。
我不使用ng-重复这里的ng模式,我应该使用什么?如何获得所有文本框值或在ng模型中应该使用什么?
myDropzone.on("success", function(file, response) {
obj = JSON.parse(response);
var removeLinkUrl = Dropzone.createElement('<span class="server_file">' + obj.delete_url + '</span>');
file.previewElement.appendChild(removeLinkUrl);
});钉模板
<div class="dz-preview dz-file-preview">
<div class="dz-details">
<div class="dz-filename"><span data-dz-name></span></div>
<div class="dz-size" data-dz-size></div>
<img data-dz-thumbnail />
</div>
<div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
<div class="dz-success-mark"><span>✔</span></div>
<div class="dz-error-mark"><span>✘</span></div>
<div class="dz-error-message"><span data-dz-errormessage></span></div>
</div>发布于 2014-06-18 12:46:47
try to use $compile .
JS -
$scope.choices = [{id: 'choice1'}, {id: 'choice2'}, {id: 'choice3'}];
$scope.addNewChoice = function() {
var newItemNo = $scope.choices.length+1;
$scope.choices.push({'id':'choice' +newItemNo});
};
$scope.showAddChoice = function(choice) {
return choice.id === $scope.choices[$scope.choices.length-1].id;
}; HTML
<div class="form-group" data-ng-repeat="choice in choices">
<label for="choice" ng-show="showChoiceLabel(choice)">Choices</label>
<button ng-show="showAddChoice(choice)" ng-click="addNewChoice()">Add another choice</button>
<input type="text" ng-model="choice.name" name="" placeholder="Enter a restaurant name">
</div> https://stackoverflow.com/questions/24282489
复制相似问题