I have made one simple HTML file in angular. I want to connect my form to MongoDB.
I have attached my "html file" and "JS File".
HTML FIle
var app = angular.module('example',[]);
app.controller('TestController', function(){
$scope.user.name= "Hello";
$scope.user.mail = "test@gmail.com";
});
<html>
</!DOCTYPE html>
<html>
<head>
<title>TEST Page</title>
<!-- begin snippet: js hide: false console: true babel: false -->
</head>
<body ng-app="example" ng-controller="TestController">
<table>
<tr>
<td>Name:</td>
<td><input type="text" ng-model="user.name"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" ng-model="user.mail"></td>
</tr>
<tr>
<td colspan="2"><button ng-click="getData()"></button></td>
</tr>
</table>
</body>
</html>
Please help me......