Login Ekranı
<html>
<script src="https://code.angularjs.org/1.5.0/angular.js"></script>
<body>
<h2>Login Ekranı</h2>
<form ng-app="loginApp" ng-controller='kayitCtrl‘ name="myForm" novalidate>
<p>İsim Soyisim:<br>
<input type="text" name="user" ng-model="user" required>
<span style="color:red" ng-show="myForm.user.$dirty && myForm.user.$invalid">
<span ng-show="myForm.user.$error.required">Kullanıcı adı zorunlu</span>
</span>
</p>
<p>Email:<br>
<input type="text" name="email" ng-model="email" required ng-pattern="/^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/">
<span style="color:red" ng-show="myForm.email.$dirty && myForm.email.$invalid">
<span ng-show="myForm.email.$error.required">Email Alanı Zorunlu</span>
<span ng-show="myForm.email.$error.pattern">Gecersiz Email Adresi</span>
</span>
</p>
<p>
<input type="submit" ng-click="gonder()« ng-disabled="myForm.$invalid"> </p>
</form>
<script>
var app=angular.module('loginApp',[]);
app.controller('kayitCtrl', ['$scope', function($scope){
$scope.gonder = function(){
alert("form yerine ulastı");
}
}]);
</script>
}]);
</script>
</body>
Hiç yorum yok:
Yorum Gönder