Created
September 11, 2013 14:30
-
-
Save erhangundogan/6524456 to your computer and use it in GitHub Desktop.
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> | |
| <head> | |
| <script src="http://code.angularjs.org/1.2.0-rc.2/angular.min.js"></script> | |
| <script type="text/javascript"> | |
| function formLogic($scope) { | |
| $scope.validate = function() { | |
| if ($scope.name && $scope.surname) { | |
| console.log("OK"); | |
| } else { | |
| console.log("NOT VALID!"); | |
| } | |
| } | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div ng-controller="formLogic"> | |
| <form> | |
| <input type="text" ng-model="name" placeholder="Enter your name here" /> | |
| <input type="text" ng-model="surname" placeholder="Enter your surname here" /> | |
| <input type="submit" ng-click="validate()" /> | |
| </form> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment