AngularJs:如何检查文件输入字段中的更改?
<script> var DemoModule = angular.module("Demo",[]); DemoModule .controller("form-cntlr",function($scope){ $scope.selectFile = function() { $("#file").click(); } $scope.fileNameChaged = function() { alert("select file"); }});</script><div ng-controller="form-cntlr"> <form> <button ng-click="selectFile()">Upload Your File</button> <input type="file" style="display:none" id="file" name='file' ng-Change="fileNameChaged()"/> </form> </div>
fileNameChage()
扬帆大鱼
森林海
相关分类