1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| var app = angular.module("MyApp", []); app.controller("MyCtrl", function ($scope, $http) {
$scope.get = function () { $http.get("/get", {params: {param: $scope.param}}) .success(function (data, header, config, status) { console.log(data); }) .error(function (response) { console.log(response); }) ; } $scope.post = function () { $http.post("/post", $scope.user) .success(function (data, header, config, status) { console.log(data); }) .error(function (data, header, config, status) { console.log(data); }) ; } });
|