collectionRepeat: only digest if available

This commit is contained in:
Andy Joslin
2014-04-29 06:20:57 -06:00
parent a4674180c0
commit 431449f28e
2 changed files with 5 additions and 7 deletions

View File

@@ -5,8 +5,8 @@
<title>Collection-Repeat: Early Preview</title>
<link href="http://code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<link href="../../dist/css/ionic.css" rel="stylesheet">
<script src="../../dist/js/ionic.bundle.js"></script>
<link href="style.css" rel="stylesheet">
<script src="script.js"></script>
<script src="contacts.js"></script>

View File

@@ -198,10 +198,6 @@ function($rootScope, $timeout) {
this.setCurrentIndex(startIndex);
this.lastRenderScrollValue = startPos;
// if (!this.dataSource.scope.$$phase) {
// this.dataSource.scope.$digest();
// }
},
renderItem: function(dataIndex, primaryPos, secondaryPos) {
var item = this.dataSource.getItem(dataIndex);
@@ -211,7 +207,9 @@ function($rootScope, $timeout) {
primaryPos, secondaryPos, secondaryPos
);
this.renderedItems[dataIndex] = item;
item.scope.$digest();
if (!item.scope.$$phase) {
item.scope.$digest();
}
} else {
delete this.renderedItems[dataIndex];
}