Last active
September 19, 2015 19:46
-
-
Save ysinc88/86e9bb5b0249a5b6bab1 to your computer and use it in GitHub Desktop.
Form log not working
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 lang="en" | |
ng-app="minmax" > | |
<head > | |
<title >Controllers</title > | |
<link href="../libs/bootstrap/bootstrap.min.css" | |
rel="stylesheet" > | |
<link href="main.css" | |
rel="stylesheet" > | |
</head > | |
<body > | |
<nav class="navbar navbar-inverse navbar-fixed-top" > | |
<div class="container" > | |
<div class="navbar-header" > | |
<a class="navbar-brand" | |
href="/" >Controllers | |
</a > | |
</div > | |
</div > | |
</nav > | |
<div class="container main-content" ng-controller="MinMaxCtrl"> | |
<form > | |
<div class="form-group" > | |
<label for="name" >Name</label > | |
<input type="text" | |
class="form-control" | |
ng-model="formModel.name" | |
id="name" > | |
</div > | |
<div class="form-group" > | |
<label for="email" >Email</label > | |
<input type="email" | |
class="form-control" | |
ng-model="formModel.email" | |
id="email" > | |
</div > | |
<div class="form-group" > | |
<label for="password" >Password</label > | |
<input type="password" | |
class="form-control" | |
ng-model="formModel.password" | |
id="password" > | |
</div > | |
<div class="form-group" > | |
<button class="btn btn-primary" ng-click="onSubmit()">Register | |
</button > | |
</div > | |
</form > | |
<pre>{{ formModel | json}}</pre> | |
</div > | |
<script src="../libs/angular/angular.min.js" ></script > | |
<script src="main.js" ></script > | |
</body > | |
</html > |
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
var app = angular.module('minmax', []); | |
app.controller('MinMaxCtrl', function ($scope){ | |
$scope.formModel = {}; | |
$scope.onSubmit = function(){ | |
console.log("Submitted!"); | |
console.log($scope.formModel); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment