当我在DOM中使用blueimp文件上传器的submit()事件时,一切似乎都正常。即:
<span class="btn" ng-click="submit()">Go</span>
但是,调用$scope.submit()
似乎不起作用:
<span class="btn" ng-click="customSubmit()">Go</span>
$scope.customSubmit = function(){
$scope.doSOmthingElses();
$scope.submit();
}
当从js而不是从DOM调用时,$ scope.submit()几乎什么都不做。
答案 0 :(得分:3)
试试这个,希望能为你效劳
Controller.js
app.module('app',[])
.controller('appCtrl',function($scope){
$scope.customSubmit = function(){
$scope.doSOmthingElses();
$scope.submit();
}
})
HTML
<html ng-app="app">
<body>
<div ng-controller="appCtrl">
<span class="btn" ng-click="customSubmit()"></span>
</div>
</body>
</html>