我是angularJS的新手,我想查看我的页面是否脏。我知道如何检查脏表格但不是整页(就像我在这种形式使用指令)。有没有办法检查指令部分是否脏?就像在我的页面中我有星级评级指令。如果我改变评级,那么我想检查页面是否脏?
<form name="reviewForm">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div>
<table class="rwd-table table-responsive table-bordered table-striped" >
<tbody>
<tr data-ng-repeat="review in reviewModifyData.review.KeyAreaList" >
<td class="mywidth">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<strong class="reviewPadding">
<span data-ng-bind="review.Title"></span>
</strong>
<br>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<small class="reviewPadding"><span data-ng-bind="review.HelpText | limitTo:150"></span><span tooltip-placement="auto" uib-tooltip="{{review.HelpText}}" data-ng-show="review.HelpText.length > 150">...</span></small>
</div>
</td>
<td >
<span class="visible-sm visible-xs"> </span>
<angular-star-rating min="reviewModifyData.minValue" max="reviewModifyData.review.RatingLevel"
value='review.Rate' hover='reviewModifyData.changeOnHover'
is-readonly='reviewModifyData.isReadonly'>
</angular-star-rating>
</td>
</tr>
</tbody>
</table>
<br>
<div class="row" data-ng-if="reviewModifyData.section.length !== 0" data-ng-class="{'has-error': reviewForm.$submitted && reviewForm.Remark.$invalid,'has-feedback': reviewForm.$submitted && reviewForm.Remark.$valid}">
<div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label class="control-label" > Remark</label> <span data-ng-if="reviewModifyData.review.IsRemarkMandetory" class="errortext">*</span>
<div class="has-feedback">
<textarea class="form-control noresize" data-ng-if="!reviewModifyData.review.IsRemarkMandetory" rows="3" name="Remark" placeholder="Enter Remark" data-ng-model='reviewModifyData.review.Remark' ></textarea>
<textarea class="form-control noresize" required data-ng-if="reviewModifyData.review.IsRemarkMandetory" rows="3" name="Remark" placeholder="Enter Remark" data-ng-model='reviewModifyData.review.Remark' ></textarea>
</div>
<span class="text-danger" data-ng-show="reviewForm.$submitted && reviewForm.Remark.$error.required">Please Enter Remark <i class="fa fa-exclamation-circle"></i></span>
</div>
</div>
</div>
</div>
</div>
</form>
现在我已经尝试了这样的js。
if ($scope.reviewForm.$dirty) {
toastr.error('The form is dirty, do you want to stay on the page?');
return;
}
提前致谢,