Created
April 17, 2013 08:09
-
-
Save Burgov/5402594 to your computer and use it in GitHub Desktop.
angular forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js"></script> | |
<script> | |
angular.module('app', []); | |
angular.module('app').controller('test', function($scope) { | |
}); | |
</script> | |
</head> | |
<body> | |
<div ng-controller="test"> | |
<form name="testform" ng-submit="sendForm()"> | |
<input type="text" name="testfield" required> | |
</form> | |
<div ng-show="testform.testfield.$error.required">REQUIRED</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment