In my AngularJS code snippet below, I am validating email input within an ng-repeat loop and associating it with a specific individual using 'data.affiliateSelect.customer_no'.
To ensure unique names for each email input field, I am appending the customer_no to the name attribute. However, I am facing difficulties referencing this dynamically generated name in the span.error-msg ngShow expression. Can anyone provide guidance on how to achieve this?
Thank you in advance.
<form name="registrantForm" ng-submit="submitRegistrantForm()" novalidate>
<div class="session-registrant-field field-email" ng-if="data.affiliateSelect.ask_email == 'Y'">
<label for="">Email
<span class="error-msg" ng-show="registrantForm.$submitted || registrantForm.(email+'-'+data.affiliateSelect.customer_no).$touched">
<span ng-show="registrantForm.(email+'-'+data.affiliateSelect.customer_no).$error.required">Please provide your email.</span>
<span ng-show="registrantForm.(email+'-'+data.affiliateSelect.customer_no).$error.email">Please enter a valid email.</span>
</span>
</label>
<input type="email" name="email-{{data.affiliateSelect.customer_no}}" id="email-{{data.affiliateSelect.customer_no}}" value"" ng-model="affiliateEmail" required>
</div>
</form>