Create a form with the following structure:
<div class="form-box" id="login-box">
<div class="header">Sign In</div>
<form>
<div class="body bg-gray">
<div class="form-group">
<input type="text" name="userid" ng-model="login.user_user" class="form-control" placeholder="User ID"/>
</div>
<div class="form-group">
<input type="password" name="password" ng-model="login.user_pass" class="form-control" placeholder="Password"/>
</div>
<div class="form-group">
<input type="checkbox" name="remember_me"/> Remember me
</div>
</div>
<div class="footer">
<button type="submit" class="btn bg-olive btn-block" ng-click="doLogin(login)">Sign me in</button>
</div>
</form>
</div>
Additionally, in the controller section, include the following code:
//Controller for user login
app.controller('login', function ($scope) {
//initialize objects to avoid errors
$scope.doLogin = {};
logdata = {};
$scope.doLogin = function (logdata) {
$http.post('urltopost').then(function(result){
if(result.data.flag==1)
{
window.location = "home.html";
}
else
{
alert('Incorrect username or password!');
}
});
};
});