ng-bs-daterangepicker
ng-bs-daterangepicker copied to clipboard
How to submit form
HI I am use datarange picker
i m getting error when i try to submit form and dates4 value is not pass in another page when submit form
this is my code
xTractApp.controller('TestController', function($scope, $http, $timeout, $location, $state) { // function to submit the form after all validation has occurred $scope.user = {};
$scope.submitForm = function(isValid) { if (isValid) { $scope.loading = true; $timeout(function() { $http({ method: 'POST', url: 'Demo', headers: {'Content-Type': 'application/json'}, data: $scope.user }).success(function (data) { $scope.loading = false; $scope.status=data;
if(($scope.status=data) == "success"){
$state.go('Dashboard');
$scope.message ="successfully ";
}
else{
$scope.loading = true;
$scope.message ="Something was wrong please try again";
}
});
}, 1000);
}
else{
$scope.loading = true;
$scope.message ="invalid username and password";
}
}; });