1

I'm trying to use the carousel directive, and am getting two errors.

First error:

Unknown provider: $animateCssProvider <- $animateCss <- .item-animation 

Second error:

TypeError: $animate.on is not a function 

package.json:

"bootstrap": "*", "angular": ">=1.4.0", "grunt-angular-templates": "1.0.4", "angular-animate": "1.4.0", "angular-translate": "^2.7.0", "angular-ui-bootstrap": "^1.2.4", "checklist-model": "*", "numeral": "*", "angular-numeraljs": "^1.0" 

controller:

var estateCarouselController = presentation.controller('estateCarouselController',['$scope',function($scope){ $scope.myInterval = 3000; $scope.noWrapSlides = false; $scope.active = 0; $scope.slides = [ { image: 'http://lorempixel.com/400/200/' }, { image: 'http://lorempixel.com/400/200/food' }, { image: 'http://lorempixel.com/400/200/sports' }, { image: 'http://lorempixel.com/400/200/people' } ]; } 

markup:

<uib-carousel active="0" interval="myInterval"> <uib-slide ng-repeat="slide in slides" index="$index"> <img ng-src="{[{slide.image}]}" style="margin:auto;" /> <div class="carousel-caption"> <h4>Slide {[{$index+1}]}</h4> </div> </uib-slide> </uib-carousel> 

NOTE: Delimiter is to avoid conflict with Twig.

EDIT: Module declaration.

var presentation = angular.module('presentation', ['ngNumeraljs','apiModule',"checklist-model",'ngAnimate',"ui.bootstrap"]); 
5
  • make sure that you have the correct dependencies in your module declaration angular.module("app", ["shared", "ui.bootstrap"]);CommentedAug 16, 2016 at 14:57
  • As @fireydude said, and don't forget ngAnimate, too. It's likely the $animate from ngAnimate is not available.
    – Drkdra
    CommentedAug 16, 2016 at 15:00
  • What is shared? Is that a dependency created by ngAnimate? I am ofc including ngAnimate in my module. Are the versions ok?
    – Slytherin
    CommentedAug 16, 2016 at 15:39
  • you also need ui.bootstrap. You should post your module declarationCommentedAug 16, 2016 at 16:06
  • Edited for more clarification
    – Slytherin
    CommentedAug 16, 2016 at 16:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.