양식의 제출 버튼에서 ng-disabled를 사용하고 있습니다. 필드를 채울 때 inputForm. $ valid가 true이고 ng-enable이 true 값을 가져와 버튼을 활성화해야합니다.ng-disabled를 사용하여 활성화/비활성화 버튼
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
</head>
<body ng-app="">
<form name="inputForm" >
<div>
<label>Name</label>
<input type="text" name="name" required />
</div>
<div>
<label>Email</label>
<input type="text" name="email" required/>
</div>
<button type="submit" ng-disabled="{{inputForm.$valid}}">
Submit
</button>
</form>
{{inputForm.$valid}}
{{inputForm.$invalid}}
{{inputForm.$dirty}}
{{inputForm.$pristine}}
</body>
</html>
하지만 버튼은 필드에 입력 한 경우에도. 내가 뭘 잘못 사용할 점점되지 않는 이유는 무엇입니까? 양식이 사용되어야한다
. 이것은 일을 이해하기위한 모의 일뿐이었습니다. –