From 1f16a93c9c3455b1087d9af74086b21e2de968fa Mon Sep 17 00:00:00 2001 From: neha1908 Date: Mon, 5 Jun 2017 16:41:16 +0530 Subject: [PATCH] item width undefined on init issue resolved --- dist/ui-carousel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/ui-carousel.js b/dist/ui-carousel.js index 2419a65..72e6320 100644 --- a/dist/ui-carousel.js +++ b/dist/ui-carousel.js @@ -135,14 +135,16 @@ angular.module('ui.carousel.controllers').controller('CarouselController', ['$sc */ this.initUI = function () { _this.width = $element[0].clientWidth; + // In initTrack _this.itemWidth is undefined + _this.updateItemStyle(); // Update track width first _this.initTrack(); // Then item style - $timeout(function () { - _this.updateItemStyle(); - }, 200); + // $timeout(function () { + // _this.updateItemStyle(); + // }, 200); }; /**