模太框刷新問題,加了驗證。第一次新增的時候輸入了input內(nèi)容點(diǎn)保存,第二次再點(diǎn)新增驗證不可空就顯示出來了。
? <div class="actions" >
? ? ? ? ? ? ? ? ? ? <div class="btn-group" ng-class="{'discolor':edite==true}">
? ? ? ? ? ? ? ? ? ? ? ? <a class="btn green-haze btn-outline ?btn-sm" ng-click="fromupdate()" data-toggle="modal" data-target="#Job-type" data-close-others="true">
? ? ? ? ? ? ? ? ? ? ? ? ? ? <i class="glyphicon glyphicon-plus"></i>
? ? ? ? ? ? ? ? ? ? ? ? ? ? 新增職稱
? ? ? ? ? ? ? ? ? ? ? ? </a>
? ? ? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? ? ? </div>
<div style="position: absolute;top: 18%;right:22%" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" id="Job-type" aria-labelledby="myLargeModalLabel" aria-haspopup="true" aria-hidden="true" aria-expanded="false">
? ? ? ? <div class="modal-dialog modal-sm">
? ? ? ? ? ? <div class="modal-content">
? ? ? ? ? ? ? ? <div class="modal-header">
? ? ? ? ? ? ? ? ? ? <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
? ? ? ? ? ? ? ? ? ? <h4 class="modal-title">職稱</h4>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? ? ? <div class="modal-body">
? ? ? ? ? ? ? ? ? ? <form class="form-horizontal" role="form" name="createAcc_form">
? ? ? ? ? ? ? ? ? ? ? ? <input ng-class="{'red':createAcc_form.job.$invalid && !createAcc_form.job.$pristine}" ng-minlength="2"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?required name="job" class="form-control ng-pristine ng-valid" ng-model="job.name" type="text" style="display:inline-block;"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?>
? ? ? ? ? ? ? ? ? ? </form>?
? ? ? ? ? ? ? ? ? ? <p class="text-muted">長度限制為2-50個字符。</p>?
? ? ? ? ? ? ? ? ? ? <p class="text-muted" ng-show="createAcc_form.job.$invalid && !createAcc_form.job.$error.required" style="color:red">職稱不合法</p>
? ? ? ? ? ? ? ? ? ? <div ng-show="createAcc_form.job.$dirty && createAcc_form.job.$invalid">
? ? ? ? ? ? ? ? ? ? ? ? <p class="text-muted" ng-if="createAcc_form.job.$error.required" style="color:red">職稱不能為空</p>
? ? ? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? ? ? <div class="modal-footer">
? ? ? ? ? ? ? ? ? ? <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">關(guān) 閉</button>
? ? ? ? ? ? ? ? ? ? <input type="button" ?class="btn btn-primary" ng-disabled="createAcc_form.$invalid" ng-click="zcSure()" value="保 存 ">
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? </div>
? ? </div>