如何使用angularjs从某个地方(另一种方法)在指令中提交表单

如何使用angularjs从某个地方(另一种方法)在指令中提交表单,angularjs,Angularjs,如何使用AngularJs从某个地方(另一种方法)在指令中提交表单。这里我添加了我的代码。我需要从不同的地方调用此导出提交。此表单提交是导出记录数的最佳方式。请给出解决方案。提前谢谢 App.directive('exportData',function(){ return { restrict : 'AE', templateUrl: "ajs/views/exportData.html", controller: 'exportDa

如何使用AngularJs从某个地方(另一种方法)在指令中提交表单。这里我添加了我的代码。我需要从不同的地方调用此导出提交。此表单提交是导出记录数的最佳方式。请给出解决方案。提前谢谢

App.directive('exportData',function(){
      return {
        restrict : 'AE',
        templateUrl: "ajs/views/exportData.html",
        controller: 'exportDataController'
    }
});

exportData.html

<form method=post id='export_lead' class='leadExport' action='/app/dao/test?a=bulkExport'><input type='hidden' name='ids' id='ids' value='" + JSON.stringify(ids) + "'></form>

// from controller
$scope.exportLeads = function(type, reportData)
{
    // Here I need to call form submit.
    angular.element(document.getElementById('export_lead')).triggerHandler('click');
};
App.directive('exportData',function(){
返回{
限制:“AE”,
templateUrl:“ajs/views/exportData.html”,
控制器:“exportDataController”
}
});
exportData.html
//来自控制器
$scope.exportLeads=函数(类型,reportData)
{
//在这里,我需要调用表单提交。
元素(document.getElementById('export_lead')).triggerHandler('click');
};

我很困惑,您有一个指令,该指令只显示一个隐藏按钮,而表单中没有任何内容,您想触发对隐藏按钮的单击吗?您好。。。我想提交一份表格。怎么做?