Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. // amadeusounds.controller('ValidateController',
  2. // [
  3. // '$scope',
  4. // '$rootScope',
  5. // '$location',
  6. // '$filter',
  7. // 'UserService',
  8. //
  9. // function($scope, $rootScope, $location, $filter, UserService) {
  10. //
  11. // $scope.register = function() {
  12. // UserService.authenticate($.param({
  13. // first: $scope.first,
  14. // last: $scope.last,
  15. // email: $scope.email,
  16. // password: $scope.password,
  17. // image: $scope.image,
  18. // bio: $scope.bio,
  19. // website: $scope.website
  20. // }), function(authenticationResult) {
  21. // UserService.post(function(u) {
  22. // $rootScope.user = u;
  23. // alert("NAJAVEN");
  24. // });
  25. // $rootScope.loginAction = true;
  26. // if($rootScope.returnPath
  27. // && $rootScope.returnPath != "/login") {
  28. // $location.path($rootScope.returnPath);
  29. // delete $rootScope.returnPath;
  30. // } else {
  31. // $location.path("/");
  32. // }
  33. // alert("NAJAVEN JOK " + authenticationResult);
  34. // },
  35. // function() {
  36. // //toaster.pop('error', $filter('translate')('generic.login_error'),
  37. // // $filter('translate')('generic.invalid_username_or_password'));
  38. // alert("Greska pri najavuvanje");
  39. // });
  40. // };
  41. // }]);
  42.  
  43.  
  44. amadeusounds.controller("ValidateController", ['$scope', '$http', function ($scope, $http) {
  45.  
  46. $scope.SendData = function () {
  47. var data = $.param({
  48. firstName: $scope.firstName,
  49. lastName: $scope.lastName,
  50. email: $scope.email,
  51. password: $scope.password,
  52. location: $scope.location,
  53. image: $scope.image,
  54. bio: $scope.bio,
  55. website: $scope.website
  56. });
  57. $http({
  58. method: "POST",
  59. url: "/api/users/register",
  60. data: data
  61. })
  62. .then(
  63. function success1(response) {
  64. $scope.PostDataResponse = response.data.message;
  65. },
  66. function error1(response) {
  67. console.log(response);
  68. return response;
  69. }
  70. );
  71.  
  72. };
  73.  
  74. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement