Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

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

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

Other one is

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 : the weird delimiter is to avoid conflict with Twig.

EDIT : Module declaration

var presentation = angular.module('presentation', ['ngNumeraljs','apiModule',"checklist-model",'ngAnimate',"ui.bootstrap"]);
share|improve this question
    
make sure that you have the correct dependencies in your module declaration angular.module("app", ["shared", "ui.bootstrap"]); – fireydude Aug 16 at 14:57
    
As @fireydude said, and don't forget ngAnimate, too. It's likely the $animate from ngAnimate is not available. – Drkdra Aug 16 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 Aug 16 at 15:39
    
you also need ui.bootstrap. You should post your module declaration – fireydude Aug 16 at 16:06
    
Edited for more clarification – Slytherin Aug 16 at 16:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.