将数据的空值传递给 Angular-Jasny-Bootstrap

Pass Null of a Data to Angular-Jasny-Bootstrap

我正在使用 file input of jasny-boostrap in AngularJS in a Modal, so I also used the jasny-bootstrap-angular。我有两个疑问:

  1. 当我点击按钮打开模型时,我可以select然后我想要的文件。如果我 select 关闭模型的文件,当我再次打开模型时,文件将处于数据预览中,它不会被清理。当我点击我的按钮打开模式时,我想在我的 angularjs 中传递空值(或重置)此图像预览(文件输入预览缩略图);

  2. 如果单击调用模态的按钮,我想自动将图像从我的 Web 服务获取到数据预览,并自动将按钮更改为 'remove' 和 'change' 然后我得到一张照片进行维修。

我的HTML:

<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-preview thumbnail" style="width: 200px; height: 150px;"></div>
<div>
<span class="btn btn-primary btn-file">
<span class="fileinput-new">Select a image</span>
<span class="fileinput-exists">Change</span>
<input type="file" name="file" file-model="fileinput"> <!--compose.myFile-->
</span>
<a href="#" class="btn btn-primary fileinput-exists" data-dismiss="fileinput">Remover</a>
<button class="btn btn-info" ng-click="showInput()">Show Input</button>
</div>
</div>

如果我点击 'show input' 我可以看到二进制图像,我使用了这个 angularjs:

$scope.showInput = function () {
    console.log($scope.fileinput.result);
}

我正在使用这个 HTML 代码和我的 angularjs 来查看来自网络服务的图像,它一切正常:

<!-- Foto view-->
<div class="form-group">
<img ng-show="equipamento.FotoEquipamento != null" style="height:auto; width:225px;" data-ng-src="{{getImage(equipamento.FotoEquipamento)}}" />
</div>

jasny-bootstrap-angular 已更新

请查收。

现在它也支持事件处理程序。