diff --git a/js/angular/directive/collectionRepeat.js b/js/angular/directive/collectionRepeat.js index 4cfcbf863b..bb9c2e8310 100644 --- a/js/angular/directive/collectionRepeat.js +++ b/js/angular/directive/collectionRepeat.js @@ -58,13 +58,18 @@ function($collectionRepeatManager, $collectionRepeatDataSource, $parse) { if (value && !angular.isArray(value)) { throw new Error("collection-repeat expects an array to repeat over, but instead got '" + typeof value + "'."); } + rerender(value); + }); + + function rerender(value) { scrollView.resize(); dataSource.setData(value); collectionRepeatManager.resize(); - }); - + } var resize = angular.bind(collectionRepeatManager, collectionRepeatManager.resize); - ionic.on('resize', resize, window); + ionic.on('resize', function() { + rerender($scope.$eval(dataSource.listExpr)); + }, window); $scope.$on('$destroy', function() { collectionRepeatManager.destroy();