我正在使用angular-strap指令并在我的循环中显示日期选择器,如下所示:
<div data-ng-repeat="myobject in myobjects">
<div data-ng-if="myobject.category == 1">
<input type="text" data-ng-model="myobject.date" data-date-format="yyyy-mm-dd" bs-datepicker data-ng-change="update-myobject()"/>
<button type="button" class="btn" data-toggle="datepicker"><span class="glyphicon glyphicon-calendar"></span></button>
</div>
</div>
在我的firebug控制台中,我可以看到错误:
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.2.2/$rootScope/inprog?p0=%24digest
minErr/<@http://localhost:49360/Scripts/angular.js:78
beginPhase@http://localhost:49360/Scripts/angular.js:11936
Scope.prototype.$apply@http://localhost:49360/Scripts/angular.js:11733
.link/<@http://localhost:49360/Scripts/angular-strap.js:8
jQuery.event.dispatch@http://localhost:49360/Scripts/jquery-1.8.2.js:3063
jQuery.event.add/eventHandle@http://localhost:49360/Scripts/jquery-1.8.2.js:2681
jQuery.event.trigger@http://localhost:49360/Scripts/jquery-1.8.2.js:2946
.trigger/<@http://localhost:49360/Scripts/jquery-1.8.2.js:3604
.each@http://localhost:49360/Scripts/jquery-1.8.2.js:611
jQuery.prototype.each@http://localhost:49360/Scripts/jquery-1.8.2.js:241
.trigger@http://localhost:49360/Scripts/jquery-1.8.2.js:3603
Datepicker.prototype._trigger@http://localhost:49360/Scripts/bootstrap-datepicker.js:300
Datepicker.prototype.update@http://localhost:49360/Scripts/bootstrap-datepicker.js:500
Datepicker.prototype.setStartDate@http://localhost:49360/Scripts/bootstrap-datepicker.js:396
$.fn.datepicker/<@http://localhost:49360/Scripts/bootstrap-datepicker.js:1124
.each@http://localhost:49360/Scripts/jquery-1.8.2.js:611
jQuery.prototype.each@http://localhost:49360/Scripts/jquery-1.8.2.js:241
$.fn.datepicker@http://localhost:49360/Scripts/bootstrap-datepicker.js:1102
.link/<@http://localhost:49360/Scripts/angular-strap.js:8
Attributes.prototype.$observe/<@http://localhost:49360/Scripts/angular.js:5399
Scope.prototype.$eval@http://localhost:49360/Scripts/angular.js:11634
Scope.prototype.$digest@http://localhost:49360/Scripts/angular.js:11479
Scope.prototype.$apply@http://localhost:49360/Scripts/angular.js:11740
done@http://localhost:49360/Scripts/angular.js:7744
completeRequest@http://localhost:49360/Scripts/angular.js:7918
createHttpBackend/</xhr.onreadystatechange@http://localhost:49360/Scripts/angular.js:7877
如果只有一个日期选择器不在ng-repeat内,它可以正常工作。有任何想法吗?或者也许我应该使用其他日期选择器?