Skip to content

Instantly share code, notes, and snippets.

@tkc
Last active August 29, 2015 14:27
Show Gist options
  • Save tkc/b0597a6508afbbb1222c to your computer and use it in GitHub Desktop.
Save tkc/b0597a6508afbbb1222c to your computer and use it in GitHub Desktop.
angular post
app.controller('ModalInstanceCtrl', function ($scope, $modalInstance, $http, guest) {

    $scope.item = guest;

    $scope.save = function () {

        var req = {
            method: 'POST',
            url: '/rest/v1/guest/save_guest',
            data: guest
        }

        $http(req)
            .success(function(){
                location.reload();
            })
            .error(function(){
                $scope.error = true;
                $scope.$apply();
            });
    };

});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment