Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated Register
Working on connection from web to service.
  • Loading branch information
adl13006 committed Nov 24, 2015
1 parent 146c030 commit aa8ed94
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
22 changes: 19 additions & 3 deletions TeamDBAwesome/TeamDBAwesome/js/homeController.js
Expand Up @@ -62,14 +62,30 @@ angular.module('routerApp').controller('homeController', function ($scope, $http

console.log(sub);
//Unsure of how to handle local host for now
$http.post(localhost/api/newCustomer,sub)
/*
$http.post("http://localhost:3306/api/NewCustomer",sub)
.success(function (data, status, headers, config) {
$scope.messages = 'You are now registered!';
$scope.messages = 'You are now registered and may now log in. ';
})
.error(function (data, status, headers, config) {
$scope.messages = 'There was a network error. Try again later.';
$log.error(status);
});*/

var promise = $http({
method: "post",
url: "http://localhost:3306/api/NewCustomer",
headers: {
contentType: "application/json"
},
data: sub
}).
success(function (data, status, headers, config) {
alert("success");
}).
error(function (error, status, headers, config) {
//alert("failure");
console.log(error);
});
}

Expand Down
9 changes: 3 additions & 6 deletions TeamDBAwesome/TeamDBAwesome/pages/partial-register.html
@@ -1,7 +1,7 @@
<div ng-controller='homeController'>
<div class="col-md-6 col-md-offset-3">
<h2>Register</h2>{{user}}
<div ng-show="message" class="alert alert-danger">{{message}}</div>
<h2>Register</h2>
<div ng-show="messages" class="alert alert-danger">{{messages}}</div>
<form name="form" role="form">
<div class="form-group" ng-class="{ 'has-error': form.firstName.$dirty && form.firstName.$error.required }">
<label for="username">First name</label>
Expand Down Expand Up @@ -62,7 +62,4 @@
</div>
</form>
</div>
</div>

-NEED: first and Last name, addr, city, state, country, postal, phone, fax, email
-OPT: company name
</div>

0 comments on commit aa8ed94

Please sign in to comment.