我试过了slideForm.$invalid
,但它不起作用。你能建议最好的方法吗?
<form name="slideForm">
<div class="aboutFile">
<input type="file" name="file" fileread="vm.file" class="form-control" ng-model="vm.file">
<div class="create-component--perma-bg">
<i class="fa fa-plus-square-o" aria-hidden="true"></i>
<span ng-if="!vm.file.name">Add File </span>
<span ng-if="vm.file.name">{{vm.file.name}}</span>
</div>
<button type="button" class="btn btn-info bgChangeBtnInfo" ng-
click="vm.upload(vm.file)" ng-disabled="slideForm.$invalid">
Upload</button>
</div>
</form>