angular实现changeFile上传[方法二] #angular #javascript 发表于 2016-08-27 | 分类于 angular | | 阅读次数 angular实现changeFile上传[方法二]html 1<div ng-controller="form-cntlr"> <form> <button ng-click="selectFile()">Upload Your File</button> <input type="file" style="display:none" id="file" name='file' onchange="angular.element(this).scope().fileNameChanged(this)" /> </form> </div> instead of 1<input type="file" style="display:none" id="file" name='file' ng-Change="fileNameChanged()" /> can you try 1<input type="file" style="display:none" id="file" name='file' onchange="angular.element(this).scope().fileNameChanged()" /> and in your function changes instead of 1$scope.fileNameChanged = function() { alert("select file"); } can you try 123$scope.fileNameChanged = function() { console.log("select file");} 参考出处1 参考出处2