compositeIndex is undefined #44
Description
I had a situation where I was loading the view, and the div containing the snapscroll was initially not shown. The user clicks on a tab in the page, and then the div is shown. When I attempt to use the wheel to scroll, it threw an error on line 453:
var snapIndex = scope.compositeIndex[0];
compositeIndex was undefined.
When I loaded the view and had the div with angular scroll shown on init... it triggered a call to snapIndexChanged which initialized the scope's compositeIndex on line 348:
scope.compositeIndex = [current, 0];
So it seems like you're using a Changed event to do some initialization. My workaround was this ng-init hack:
<div class="element-template-bars" snapscroll="" snap-index="0" ng-init="$$childHead.compositeIndex= [0, 0];" snap-duration="300" scroll-delay="false" enable-arrow-keys="true" prevent-double-snap-delay="150">
Thanks.