【发布时间】:2016-10-24 07:53:13
【问题描述】:
我使用控制器作为语法。
当我的文件输入发生变化时,我想触发一个函数。
怎么做?
下面是我的 $scope 语法代码
<input class="upload" type="file" accept="image/*" ng-model="image"
onchange="angular.element(this).scope().uploadImage(this)">
【问题讨论】:
-
为什么不使用
ng-change="yourController.yourFunction()"? -
如果 type="file" ,ng-change 不能使用。
标签: angularjs