-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73465e6
commit 8c02bb2
Showing
2 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
var app = angular.module('minmax', []); | ||
|
||
// https://minmax-server.herokuapp.com/register/' | ||
// https://minmax-server.herokuapp.com/register/' | ||
//To Actually send a HTTPrequest we need to inject the httpService into the | ||
//controller. | ||
app.controller('MinMaxCtrl', function ($scope, $http) { | ||
$scope.formModel = {}; | ||
$scope.onSubmit = function () { | ||
console.log("I'm submitted"); | ||
console.log($scope.formModel); | ||
//$http.post(param1, param2) | ||
//param1 is the endpoint we want to send | ||
//param2 is the data which we want to send. | ||
$http.post('https://minmax-server.herokuapp.com/register/', $scope.formModel). | ||
success(function (data) { | ||
console.log(":)") | ||
}).error(function (data) { | ||
console.log(":(") | ||
}); | ||
}; | ||
}); |