<form name="loginForm" ng-controller="LoginController" ng-submit="LoginFormaction(user);" >
<div class="list list-inset">
<label class="item item-input">
<input type="email" placeholder="E-mail" ng-modal="user.emailLog">
</label>
<label class="item item-input">
<input type="password" placeholder="Password" ng-modal="user.passLog">
</label>
</div>
<div class="padding">
<div><span class="error_forget">{{login_error}}</span><span class="valid_forget">{{login_success}}</span></div>
<button type="submit" class="button button-block button-positive">Login</button>
</div>
</form>
var app = angular.module(‘massmutual’, [‘ionic’]);
app.controller(‘LoginController’,function($scope,$http){
$scope.login_error = ‘’;
$scope.login_success = ‘’;
$scope.LoginFormaction = function(user){
alert($scope.user.emailLog);
$scope.login_error = '';
$scope.login_success = '';
$http.post('login/validorin_login',{'logemails':$scope.user.emailLog,'logpasss':$scope.user.passLog}
).success(function(data, status, headers, config) {
if (data.msg != '')
{
$scope.login_success='success';
}
else
{
$scope.login_error='Invalid Email Address/Password';
}
}).error(function(data, status) {
$scope.login_error='Invalid Email Address/Password';
});
}
})