-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I'm trying to get access to my carousel. Here is controller, where I'm getting images from instagram via Promise.
angular.module('topfollowersApp')
.controller('CounterCtrl', function($scope, instagramFactory, Carousel) {
instagramFactory.getMediaFromUserById({
userId: user.instagramId,
count: 12,
access_token: localStorage.getItem("access_token"),
}).then(function(response) {
$scope.mediaItems = response.data.data;
var instagramCarousel = Carousel.get("instagramCarousel");
}).catch(function(error) {
console.log(error);
});
}
and markup. All photos placed into $scope.mediaItems and carousel works fine.
<div ng-carousel ng-carousel-name="instagramCarousel" ng-carousel-timer="1000" ng-carousel-watch="mediaItems" ng-carousel-loop="false">
<slidecontainer class="carousel-slides">
<slide ng-repeat="item in mediaItems" class="carousel-example">
<img ng-src="{{item.images.standard_resolution.url}}">
</slide>
</slidecontainer>
</div>
but I'm getting error Error: carousel with name 'instagramCarousel' does not exist when trying Carousel.get("instagramCarousel");.
Why it happens?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels