# Slide-box Dynamic Height

**URL:** <https://forum.ionicframework.com/t/slide-box-dynamic-height/2149>\
**Category:** ionic-v1\
**Created:** [March 23, 2014, 5:11pm UTC](https://forum.ionicframework.com/t/slide-box-dynamic-height/2149 "2014-03-23T17:11:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kfir](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kfir](https://forum.ionicframework.com/u/kfir)\
**Post date:** [March 24, 2014, 10:45am UTC](https://forum.ionicframework.com/t/slide-box-dynamic-height/2149/2 "2014-03-24T10:45:15Z")

</div>

Another small problem,  
With this code:

```
.controller('ListCtrl', function($scope, EventService,$location,$localStorage, $ionicActionSheet, $translate,$stateParams){

$scope.gotoSlide = function(index) { $scope.$broadcast('slideBox.setSlide', index); };

var slidenum = $stateParams.slidenum;
if($stateParams.slidenum>=0){
	$scope.$watch(function(){
		$scope.gotoSlide(slidenum);
	});
}
})

```

I’m getting this error multiplied by the number of pages that I have,

```
TypeError: Cannot read property 'length' of undefined
    at circle (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:5639:21)
    at slide (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:5666:30)
    at slide (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:6000:7)
    at http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:34181:16
    at Scope.$broadcast (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:19336:28)
    at Scope.$scope.gotoSlide (http://localhost/ionic-angular-cordova-seed-master/www/js/controllers.js:34:46)
    at Object.<anonymous> (http://localhost/ionic-angular-cordova-seed-master/www/js/controllers.js:40:10)
    at Scope.$digest (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:18897:40)
    at Scope.$apply (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:19158:24)
    at done (http://localhost/ionic-angular-cordova-seed-master/www/lib/js/ionic.bundle.js:14916:45) 
```

---

_[View the full topic](https://forum.ionicframework.com/t/slide-box-dynamic-height/2149)._
