Advertisement
Guest User

Untitled

a guest
May 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $scope.postForm = function(dataForm){
  2. $ionicLoading.show({
  3. template: 'Verifying...'
  4. });
  5. var encodedString = 'action=' +
  6. encodeURIComponent("CheckLogin") +
  7. '&user=' +
  8. encodeURIComponent(dataForm.datausername) +
  9. '&pw=' +
  10. encodeURIComponent(dataForm.datapassword);
  11. $scope.errorMsg = ""; //reset the error message
  12. $http({
  13. method: 'POST',
  14. url: 'http://mylocalhost/mysite.aspx',
  15. data: encodedString,
  16. headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  17. })
  18. .success(function(data, status, headers, config) {
  19. //some of my codes
  20.  
  21. })
  22. .error(function(data, status, headers, config) {
  23. $scope.errorMsg = 'Unable to submit form' + status;
  24. $ionicLoading.hide();
  25. })
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement