我創建的樣本程序的業務驗證,此錯誤消息顯示,但它沒有顯示具體的錯誤領域,如何解決這個問題,模態窗口(彈出)誤差現場警戒節目使用angularJs
在此先感謝。 .................................................. ..............
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.save=function()
{
if($scope.firstName == undefined)
{
$('#popup1').fadeIn($(this).data());
\t // in the RC of 1.3 there is function.link only the function customs Validation.compile which
// needs to be invoked to get at the functions.
\t \t \t \t setTimeout(function(){
\t \t \t \t \t $('#popup1').fadeOut($(this).data());
\t \t \t \t \t },3000);
\t \t \t var element = window.document.getElementById('firstName');
if (element)
element.focus();
}
if($scope.lastName = undefined){
$('#popup1').fadeIn($(this).data());
\t // in the RC of 1.3 there is function.link only the function customs Validation.compile which
// needs to be invoked to get at the functions.
\t \t \t \t setTimeout(function(){
\t \t \t \t \t $('#popup1').fadeOut($(this).data());
\t \t \t \t \t },3000);
\t \t \t var element = window.document.getElementById('lastName');
if (element)
element.focus();
}
}
});
.modal-box {
display: none;
position: absolute;
z-index: 1000;
width: 98%;
background: white;
border-bottom: 1px solid #aaa;
border-radius: 20px;
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
border: 1px solid rgba(0, 0, 0, 0.1);
background-clip: padding-box;
}
@media (min-width: 32em) {
.modal-box { width: 180px; top: 215px; left: 390px; }
}
.modal-box header,
.modal-box .modal-header {
padding: 1.25em 1.5em;
border-bottom: 1px solid #ddd;
}
.modal-box .modal-body { padding:22px; background-color: #dd4b39;
border-radius: 20px; height: 0px;
color: white;}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body >
<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<input type="submit" ng-click="save()">
</div>
<div id="popup1" class="modal-box">
<div class="modal-body">
<span style="position:absolute;top:10px;">Please Enter the Value </span>
</div>
\t \t \t \t \t </div>
</body>