0
私はAngularJSを使用して電子メールの入力を検証する以下のコードを持っています。これはng-repeatであり、私は 'data.affiliateSelect.cusomter_no'を使用することに関連する人物を追跡しています。AngularJS電子メールの検証で、動的名で入力を使用
電子メール入力の名前にcustomer_noを追加して、すべてが一意の名前を持つようにします。 この名前をspan.error-msg ngShow式内でどのように参照できますか?私は成功していないいくつかの異なる方法を試してみました。
ありがとうございます。上記
<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>