Skip to content

Commit cd5a5ea

Browse files
committed
amend(collectionRepeat): if data.length is 0, refresh data
1 parent f656672 commit cd5a5ea

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

js/angular/directive/collectionRepeat.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ function CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$r
223223
"but got a " + typeof value);
224224
}
225225

226-
if (newValue.length) {
227-
// Wait for this digest to end before refreshing everything.
228-
$timeout(function() {
229-
getRepeatManager().refreshData(newValue);
226+
// Wait for this digest to end before refreshing everything.
227+
$timeout(function() {
228+
if (newValue.length) {
230229
refreshDimensions();
231-
}, 0, false);
232-
}
230+
}
231+
getRepeatManager().refreshData(newValue);
232+
}, 0, false);
233233
});
234234

235235
// Make sure this resize actually changed the size of the screen
@@ -579,7 +579,7 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
579579
if (item.secondarySize !== dim.secondarySize || item.primarySize !== dim.primarySize) {
580580
item.node.style.cssText = item.node.style.cssText
581581
.replace(WIDTH_HEIGHT_REGEX, WIDTH_HEIGHT_TEMPLATE_STR
582-
.replace(PRIMARY, 1 + (item.primarySize = dim.primarySize))
582+
.replace(PRIMARY, (item.primarySize = dim.primarySize) + 1)
583583
.replace(SECONDARY, (item.secondarySize = dim.secondarySize))
584584
);
585585
}

0 commit comments

Comments
 (0)