Looking for details of how this works? Check out AngularJS: Automatically submitting HTML forms. Ready to test it out? Push the button!

Submit Hidden Form

The Code

         
angular.module('angularDemoApp', [])

.directive('autoSubmitForm', function($timeout){
    return {
        restrict: 'E',
        replace: true,
        scope: {submitForm: '='},
        templateUrl: 'hiddenForm.html',
        link: function(scope, el, attr){
            $timeout(function() {
                angular.element(el).submit();
            });
        }
    };
})

.controller('DemoCtrl', function ($scope){
    $scope["utilizeInfo"] = function(){
        $scope["submitForm"] = {url: "echoForm.php", values: [{name: "name", value: "Phil"}, {name: "age", value: "23"}]};
    };
})
;                        
            
<form method="POST" action="{{ submitForm.url }}" class="hidden">       
    <input ng-repeat="field in submitForm.values" type="hidden" name="{{ field.name }}" value="{{ field.value }}" />     
</form>