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', ['UserService', '$location', '$rootScope',
- function ValidateController(UserService, $location, $rootScope) {
- var vm = this;
- vm.register =
- function() {
- alert("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0");
- vm.dataLoading = true;
- UserService.Create(vm.user)
- .then(function (response) {
- if (response.success) {
- //$scope.user=vm.user;
- // FlashService.Success('Registration successful', true);
- alert("REGISTRIRAN");
- $location.path('/login');
- } else {
- // FlashService.Error(response.message);
- vm.dataLoading = false;
- alert("NOOOOOO" + vm.user.first + vm.user.last);
- $location.path("/login");
- }
- });
- }
- }]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement