<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js"></script>
</head>
<body ng-app="myApp">
<script>
angular.module('myApp', [])
.controller('myCtrl', ['$scope',
function($scope) {
$scope.text = '';
}
]);
</script>
<style>.error{color:red}</style>
<form name="myForm"
ng-controller="myCtrl">
Enter Your Email :
<input type="email"
name="input" ng-model="text"
required>
<span class="error"
ng-show="myForm.input.$error.required">
Required!</span>
<span class="error"
ng-show="myForm.input.$error.email">
Not valid email!</span>
<br>
<br/>My Email is {{text}}
</form>
</body>
</html>
_____________________________________________________________________________________
output
Our online Angularjs training instructors rate this blog highly over all the other blogs out there for the technical information.
ReplyDeleteIt's really great and easy to understand if you are new to AngularJS. Thanks!
ReplyDeleteAngularjs Training | Angularjs Online Training
angular2 Training in Chennai | angular2 Training in Chennai
Angular 2 Training in Chennai | Angularjs Training | Angularjs Training