I have an angularjs ng-repeat form using MEAN stack, where i have an external button outside the ng-repeat to trigger all the ng-repeat form. but doing so it submits only the first ng-repeat form. all the others are not submitted. how should i submit all forms with one click.
HTML
<div class="ui-widget-content">
<ol class="minheight650">
<div class="overflow-y-scroll">
<div ng-repeat="item in subfoodss track by $index | filter:categoryfilter | filter:typefilter | filter:searchallfood">
<li ng-show="item.name" >
<div class="col-md-4">
<form name="subfoodForm" id="subfoodform" data-ng-submit="addSubfood()" >
<input type="text" data-ng-model="sbody" name="sbody" id="sbody" class="form-control" placeholder="Your Subfood" required disabled>
<input type="text" data-ng-model="sprice" name="sprice" id="sprice" class="form-control" placeholder="Your Subfood" required disabled>
<md-select data-ng-model="sqty" id="sqty" required>
<md-option value="1" selected>1</md-option>
<md-option value="2">2</md-option>
<md-option value="3">3</md-option>
</md-select>
<div class="col-md-3 ">
<input type="checkbox" >
</div>
<input type="submit" ng-click="secondFx()" id="btnTwo" value="Subfood">
</form>
</div>
</li>
</div>
</div>
<div>
<md-switch class="md-primary" ng-click="doSomething()" id="selecctall">
<h4>Confirm All</h4>
</md-switch>
</div>
</ol>
</div>
AngularJS Controller
$scope.secondFx = function() {
angular.element('#btnTwo').click();
};
$scope.doSomething = function() {
$scope.secondFx();
};