title: cannot read property 'offsetwidth' of undefined bootstrap carousel
body: <p>I have implemented a bootstrap carousel with angular JS but i have noticed that sometimes I get an error "bootstrap.min.js:6 Uncaught TypeError: cannot read property 'offsetwidth' of undefined bootstrap carousel" and the slider stops working when I try to click the controls but sometimes it works perfectly fine.    </p>
  
  <p>Can someone help me with this</p>
  
  <pre><code>&lt;div class="top" ng-show = "open_popup"  tabindex="-1" &gt;
    &lt;div id="myCarousel1" class="slider carousel slide" data-ride="carousel"&gt;
      &lt;!-- &lt;i class="fa fa-times closePopup" aria-hidden="true" ng- click = "closePopup();"&gt;&lt;/i&gt; --&gt;                   &lt;div class="carousel-inner" role="listbox"&gt;                        
      &lt;div class="item" ng-repeat="image in carouselimages" ng-if="open_popup" ng-class="{active:$index == carouselImageActive}"&gt;
        &lt;img ng-src="./uploads/{{image.imagename}}"&gt;
      &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;a class="left carousel-control" href="#myCarousel1" role="button" data-slide="prev"&gt;
      &lt;span class="glyphicon glyphicon-chevron-left" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class="right carousel-control" href="#myCarousel1" role="button" data-slide="next"&gt;
      &lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Next&lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;   
  </code></pre>