<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular input[number] Direktifleri</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
</head>
<body ng-app="ornekUygulama">
<script>
angular.module('ornekUygulama', [])
.controller('ornekController', ['$scope', function($scope) {
$scope.ornek = {
value: 12
};
}]);
</script>
<form name="benimFormum" ng-controller="ornekController">
<label>Sayı:
<input type="number" name="input" ng-model="ornek.value"
min="0" max="999" required>
</label>
<div role="alert">
<span class="hata" ng-show="benimFormum.input.$error.required">
Gerekli!</span>
<span class="hata" ng-show="benimFormum.input.$error.number">
Geçerli bir numara değil!</span>
</div>
<tt>value değeri = {{ornek.value}}</tt><br/>
<tt>benimFormum.input.$valid = {{benimFormum.input.$valid}}</tt><br/>
<tt>benimFormum.input.$error = {{benimFormum.input.$error}}</tt><br/>
<tt>benimFormum.$valid = {{benimFormum.$valid}}</tt><br/>
<tt>benimFormum.$error.required = {{!!benimFormum.$error.required}}</tt><br/>
</form>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.