Carlos Bolivar
Carlos Bolivar

Reputation: 317

Angular Filter and NgAnimate conflict

I am using angular-filter and angular-animate together, because I need do a group by in ngRepeat, but when I try to run, I am getting a error:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.5/$injector/modulerr?p0=SsrsToolApp&p1=Erro…udflare.com%2Fajax%2Flibs%2Fangular.js%2F1.4.5%2Fangular.min.js%3A37%3A180).

Testing I detected a possible conflict, because when remove ['ngAnimate'], it is working fine.

This is the code example with error:

<!doctype html>
<html ng-app="SsrsToolApp">
<head>

</head>
<body>
    ...
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular-animate.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.8/angular-filter.js"></script>
    ready
    <script>
        
        var ssrsApp = angular.module('SsrsToolApp', ['ngAnimate'], ['angular.filter']);

    </script>
    ...
</body>
</html>

I need those modules in my app. What do you think? How can I do to solve this problem?

Upvotes: 0

Views: 106

Answers (1)

Explosion Pills
Explosion Pills

Reputation: 191729

To inject multiple modules in AngularJS specify them as array elements:

var ssrsApp = angular.module('SsrsToolApp', ['ngAnimate', 'angular.filter']);

The third argument to angular.module is a configuration function. The error you are getting is complaining that you're injecting a string ('angular.filter') rather than a function.

Upvotes: 0

Related Questions