Estou com 2 problemas quando abro o meu modal:
Após abrir o modal, selecionar uma foto e fechar, quando eu abro novamente, a foto que estava não é zerada (reset), eu estou com dúvidas de como passar null para essa variável.
Eu gostaria de passar uma foto do servidor para o segundo botão, mas não sei como fazer isso.
Montei um plunker para ajudar a entender o problema:
<!DOCTYPE html>
<html ng-app="MyApp">
<head>
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js"></script>
<script src="jasny-bootstrap-angular.js"></script>
<link rel="stylesheet" href="style.css">
<script src="app.js"></script>
</head>
<body ng-controller="JasnyfoController">
<br />
<button data-ng-click="openmodal()" class="btn btn-primary">Open (null) Modal</button>
<button data-ng-click="openmodal2()" class="btn btn-primary">Open from picture Modal</button>
<div class="modal fade" id="jasnymodal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
<h4 class="modal-title" id="H1" ng-hide="editMode || viewMode">Jasny Modal - Pass null to Jasny</h4>
</div>
<div class="modal-body">
<br />
<br />
<js-file-input ng-model="fileinput" data-input-attrs='{"name": "fileInput"}' data-preview-attrs='{"style": "width: 159px; height: 100px;"}'></js-file-input>
<br />
<br />
<button class="btn btn-info" ng-click="showInput()">Show Input</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="jasnymodal2" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
<h4 class="modal-title" id="H1" ng-hide="editMode || viewMode">Jasny Modal - Pass a image from server to Jasny</h4>
</div>
<div class="modal-body">
<br />
<br />
<js-file-input ng-model="fileinput" data-input-attrs='{"name": "fileInput"}' data-preview-attrs='{"style": "width: 159px; height: 100px;"}'></js-file-input>
<br />
<br />
<button class="btn btn-info" ng-click="showInput()">Show Input</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>