html:
<input name="image" id="image" type="file" value="" multiple accept="image/*" ng-model="imagePath" ng-change="editPic()" />
controller:
$scope.editPic = function(){
console.log(1);
};
我想在选择图片后,触发一个事件,为什么这样不会触发controller里的事件?谢谢。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我这里有一个 angular 中 input type="file" 的指令,用法是
<input type="file" file-read="uploadMe" />coffeeScript的格式,自己转换成JS就好
首先,请把代码贴完整;
其次,你这里只是绑定了input的change事件,跟图片有啥关系??
你可以试试ng-file-upload,很强大