You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
908 B

  1. 'use strict';
  2. angular.module('app.signup', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/signup', {
  5. templateUrl: 'views/signup/signup.html',
  6. controller: 'SignupCtrl'
  7. });
  8. }])
  9. .controller('SignupCtrl', function($scope, $http, $routeParams, $rootScope) {
  10. $scope.user = {};
  11. $scope.signup = function() {
  12. console.log('Doing signup', $scope.user);
  13. $http({
  14. url: $rootScope.server + 'signup',
  15. method: "POST",
  16. headers: {
  17. "Content-Type": undefined
  18. },
  19. data: $scope.user
  20. })
  21. .then(function(data) {
  22. console.log("data: ");
  23. console.log(data.data);
  24. window.location="/";
  25. },
  26. function(data) {
  27. console.log(data);
  28. });
  29. };
  30. });