<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular input[url] Direktifleri</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
</head>
<body ng-app="ornekModul">
<script>
angular.module('ornekModul', [])
.controller('ornekController', ['$scope', function($scope) {
$scope.url = {
text: 'http://w3tr.com'
};
}]);
</script>
<form name="benimFormum" ng-controller="ornekController">
<label>URL:
<input type="url" name="input" ng-model="url.text" required>
<label>
<div role="alert">
<span class="hata" ng-show="benimFormum.input.$error.required">
Gerekli!</span>
<span class="hata" ng-show="benimFormum.input.$error.url">
Geçerli bir url değil!</span>
</div>
<tt>text = {{url.text}}</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/>
<tt>benimFormum.$error.url = {{!!benimFormum.$error.url}}</tt><br/>
</form>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.