Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. $scope.LogIn = function () {
  2. $http({
  3. url: "http://www.ccuktech.co.uk/ccuploader/users/login",
  4. method: "POST",
  5. data: $.param({'username': $scope.UserName, 'password': $scope.PassWord}),
  6. headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  7. }).then(function (response) {
  8. // success
  9. console.log('success');
  10. console.log("then : " + JSON.stringify(response));
  11. GetData();
  12. // location.href = '/cms/index.html';
  13. }, function (response) { // optional
  14. // failed
  15. console.log('failed');
  16. console.log(JSON.stringify(response));
  17. });
  18. };
  19.  
  20.  
  21. $scope.UserData = function ($scope) {
  22. $scope.UserName = "";
  23. $scope.PassWord = "";
  24. };
  25.  
  26. $scope.GetData = function () {
  27. $http({
  28. url: " http://www.ccuktech.co.uk/ccuploader/campaigns/getCampaign",
  29. method: "POST",
  30. headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  31. }).then(function (response) {
  32. // success
  33. console.log('you have received the data ');
  34. console.log("then : " + JSON.stringify(response));
  35. location.href = '/cms/index.html';
  36. }, function (response) { // optional
  37. // failed
  38. console.log('failed');
  39. console.log(JSON.stringify(response));
  40. });
  41. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement