From d5d38bb081258ac003f92b9734043801a34ed7a4 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 7 Jul 2014 11:48:44 -0600 Subject: [PATCH] refactor(collectionRepeat): add a require-able controller to the directive --- js/angular/directive/collectionRepeat.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/angular/directive/collectionRepeat.js b/js/angular/directive/collectionRepeat.js index 7b9bd89869..e3b3b4ede7 100644 --- a/js/angular/directive/collectionRepeat.js +++ b/js/angular/directive/collectionRepeat.js @@ -18,19 +18,19 @@ * Here are a few things to keep in mind while using collection-repeat: * * 1. The data supplied to collection-repeat must be an array. - * 2. You must explicitly tell the directive what size your items will be in the DOM, using directive attributes. + * 2. You must explicitly tell the directive what size your items will be in the DOM, using directive attributes. * Pixel amounts or percentages are allowed (see below). * 3. The elements rendered will be absolutely positioned: be sure to let your CSS work with * this (see below). * 4. Keep the HTML of your repeated elements as simple as possible. - * The more complicated your elements, the more likely it is that the on-demand compilation will cause + * The more complicated your elements, the more likely it is that the on-demand compilation will cause * some jerkiness in the user's scrolling. * 6. Each collection-repeat list will take up all of its parent scrollView's space. * If you wish to have multiple lists on one page, put each list within its own * {@link ionic.directive:ionScroll ionScroll} container. * 7. You should not use the ng-show and ng-hide directives on your ion-content/ion-scroll elements that * have a collection-repeat inside. ng-show and ng-hide apply the `display: none` css rule to the content's - * style, causing the scrollView to read the width and height of the content as 0. Resultingly, + * style, causing the scrollView to read the width and height of the content as 0. Resultingly, * collection-repeat will render elements that have just been un-hidden incorrectly. * * @@ -88,7 +88,7 @@ * * * ``` - * Percentage of total visible list dimensions. This example shows a 3 by 3 matrix that fits on the screen (3 rows and 3 colums). Note that dimensions are used in the creation of the element and therefore a measurement of the item cannnot be used as an input dimension. + * Percentage of total visible list dimensions. This example shows a 3 by 3 matrix that fits on the screen (3 rows and 3 colums). Note that dimensions are used in the creation of the element and therefore a measurement of the item cannnot be used as an input dimension. * ```css * .my-image-item img { * height: 33%; @@ -147,6 +147,7 @@ function($collectionRepeatManager, $collectionDataSource, $parse) { terminal: true, $$tlb: true, require: '^$ionicScroll', + controller: [function(){}], link: function($scope, $element, $attr, scrollCtrl, $transclude) { var scrollView = scrollCtrl.scrollView; if (scrollView.options.scrollingX && scrollView.options.scrollingY) {