Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PostCtrl($scope, $element, $http, $templateCache) {
- $scope.method = 'POST';
- $scope.url = 'url.php';
- $scope.codeStatus = "";
- var FormData = { 'name' : document.f1.name.value, 'password' : document.f1.password.value };
- $scope.add = function() {
- $http({method: $scope.method, data: FormData, url: $scope.url, headers: {'Content-Type': 'application/x-www-form-urlencoded'}, cache: $templateCache}).
- success(function(response) {
- $scope.codeStatus = response.data;
- }).
- error(function(response) {
- $scope.codeStatus = response || "Request failed";
- });
- return false;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement