luisfarzati / ng-bs-daterangepicker

AngularJS directive for bootstrap-daterangepicker
http://luisfarzati.github.io/ng-bs-daterangepicker/
MIT License
246 stars 167 forks source link

How to submit form #86

Open Gajendrasinh opened 8 years ago

Gajendrasinh commented 8 years ago

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";
   }

}; });