为什么在加载页面时我的反馈字形显示?
Plunker - http://plnkr.co/edit/dRtZUoDP0xUwhI3SWVrV?p=preview
HTML
<div class="row">
<div class="col-xs-5">
<div class="form-group" ng-class="{ 'has-success has-feedback' : infoForm.cardExpMonth.$valid }">
<label class="control-label">Expiration Month</label>
<div class="right-inner-addon">
<input type="text" class="form-control" ng-model="newCard.expirationMonth" required cc-exp-month name="cardExpMonth" placeholder="MM" />
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="form-group" ng-class="{ 'has-success has-feedback' : infoForm.cardExpYear.$valid }">
<label class="control-label">Expiration Year</label>
<div class="right-inner-addon">
<input type="text" class="form-control" ng-model="newCard.expirationYear" required cc-exp-year name="cardExpYear" placeholder="YY" />
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
只需在图标上使用ng-show
进行快速解决,这样就足够了吗?
<div class="row">
<div class="col-xs-5">
<div class="form-group" ng-class="{ 'has-success has-feedback' : infoForm.cardExpMonth.$valid }">
<label class="control-label">Expiration Month</label>
<div class="right-inner-addon">
<input type="text" class="form-control" ng-model="newCard.expirationMonth" required cc-exp-month name="cardExpMonth" placeholder="MM" />
<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="infoForm.cardExpMonth.$valid" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="form-group" ng-class="{ 'has-success has-feedback' : infoForm.cardExpYear.$valid }">
<label class="control-label">Expiration Year</label>
<div class="right-inner-addon">
<input type="text" class="form-control" ng-model="newCard.expirationYear" required cc-exp-year name="cardExpYear" placeholder="YY" />
<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="infoForm.cardExpYear.$valid" aria-hidden="true"></span>
</div>
</div>
</div>
</div>