Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // amadeusounds.controller('ValidateController',
- // [
- // '$scope',
- // '$rootScope',
- // '$location',
- // '$filter',
- // 'UserService',
- //
- // function($scope, $rootScope, $location, $filter, UserService) {
- //
- // $scope.register = function() {
- // UserService.authenticate($.param({
- // first: $scope.first,
- // last: $scope.last,
- // email: $scope.email,
- // password: $scope.password,
- // image: $scope.image,
- // bio: $scope.bio,
- // website: $scope.website
- // }), function(authenticationResult) {
- // UserService.post(function(u) {
- // $rootScope.user = u;
- // alert("NAJAVEN");
- // });
- // $rootScope.loginAction = true;
- // if($rootScope.returnPath
- // && $rootScope.returnPath != "/login") {
- // $location.path($rootScope.returnPath);
- // delete $rootScope.returnPath;
- // } else {
- // $location.path("/");
- // }
- // alert("NAJAVEN JOK " + authenticationResult);
- // },
- // function() {
- // //toaster.pop('error', $filter('translate')('generic.login_error'),
- // // $filter('translate')('generic.invalid_username_or_password'));
- // alert("Greska pri najavuvanje");
- // });
- // };
- // }]);
- amadeusounds.controller("ValidateController", ['$scope', '$http', function ($scope, $http) {
- $scope.SendData = function () {
- var data = $.param({
- firstName: $scope.firstName,
- lastName: $scope.lastName,
- email: $scope.email,
- password: $scope.password,
- location: $scope.location,
- image: $scope.image,
- bio: $scope.bio,
- website: $scope.website
- });
- $http({
- method: "POST",
- url: "/api/users/register",
- data: data
- })
- .then(
- function success1(response) {
- $scope.PostDataResponse = response.data.message;
- },
- function error1(response) {
- console.log(response);
- return response;
- }
- );
- };
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement