【发布时间】:2017-08-23 11:06:24
【问题描述】:
如果条件为真,我想更改此表单字段。
<input type="email"
name="UserEmail"
id="UserEmail"
class="form-control"
ng-class="{'invalid-signup': signUpForm.UserEmail.$invalid && signUpForm.UserEmail.$dirty, 'valid-signup': signUpForm.UserEmail.$valid && signUpForm.UserEmail.$dirty}"
placeholder="Primary contact email."
ng-required="true"
ng-maxlength="30"
ng-minlength="5"
ng-model="signUpModel.UserEmail"/>
<div ng-show="signUpForm.UserEmail.$dirty && signUpForm.UserEmail.$invalid">
<p ng-show="signUpForm.UserEmail.$error.required">Email is required.</p>
<p ng-show="signUpForm.UserEmail.$error.pattern">Email is not valid.</p>
<p ng-show="signUpForm.UserEmail.$error.minlength">Email is too short, min 5 characters.</p>
<p ng-show="signUpForm.UserEmail.$error.maxlength">Email is too long, max 30 characters.</p>
</div>
所以我有一个标志变量,如果这是真的,我想将字段占位符和值更改为某种东西。
$scope.isGoogleLoginWorking = true;
有没有办法做到这一点。
感谢您的建议。
【问题讨论】:
标签: javascript html angularjs