0

when I trying to add ui_bootstrap it throws error it gives the error

Uncaught TypeError: angular.module(...).controller(...).directive(...).directive(...).animation is not a function

What could be the problem, I have not added any code yet

html head

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Blog</title>
    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/blog.css' %}" rel="stylesheet">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

    <script src='{% static 'js/jquery.min.js' %}'></script>

    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/angular.js' %}"></script>
    <script src="{% static 'js/app.js' %}"></script>
    <script src="{% static 'js/ui_bootstrap.js' %}"></script>
    <script src="{% static 'js/controllers.js' %}"></script>
    <script src="{% static 'js/cookies.js' %}"></script>
</head>

What could be the issue.....seems strange for me....When I remove ui_bootstrap.js link the error goes off

app.js

var sampleApp = angular.module('myApp', ['ngCookies']);

sampleApp.config(['$routeProvider',
    function($routeProvider) {
        $routeProvider.
            when('/', {
                templateUrl: '/static/views/home.html',
                controller: 'index_ctrl'
            })
            .when('/:id', {
                templateUrl: '/static/views/detail.html',
                controller: 'detail_ctrl'
            })
    }
])

sampleApp.filter('cut', function () {
        return function (value, wordwise, max, tail) {
            if (!value) return '';

            max = parseInt(max, 10);
            if (!max) return value;
            if (value.length <= max) return value;

            value = value.substr(0, max);
            if (wordwise) {
                var lastspace = value.lastIndexOf(' ');
                if (lastspace != -1) {
                    value = value.substr(0, lastspace);
                }
            }

            return value + (tail || ' …');
        };
    });

Any help is appreciated................

1 Answer 1

1

I assume that ui-bootstrap is injected into module in app.js. If so, move the app.js script tag after the ui-bootstrap.js tag.

Sign up to request clarification or add additional context in comments.

7 Comments

Can you update your post to include your module declaration from app.js?
Ok. Move cookies.js tag above app.js tag.
@jbrown...did not help...I removed cookies...still same issues
Not sure if its related but your syntax on your jquery include should be <script src="{% static 'js/jquery.min.js' %}"></script>
That's possible. What version of ui-bootstrap are you using? Even the older versions of ui-bootstrap require angular 1.2.x
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.