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.

34 lines
883 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.signup = function() {
  11. console.log('Doing signup', $scope.user);
  12. $http({
  13. url: apiurl + 'signup',
  14. method: "POST",
  15. headers: {
  16. "Content-Type": undefined
  17. },
  18. data: $scope.user
  19. })
  20. .then(function(data) {
  21. console.log("data: ");
  22. console.log(data.data);
  23. window.location="/#!/login";
  24. },
  25. function(data) {
  26. console.log(data);
  27. });
  28. };
  29. });