Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.0/$injector/modulerr?p0=app&p1=Error%3A%20%….c%20

Tags:

angularjs

I got this error when trying to write my code. I've been through the other Stackflow questions and can't find an answer. What is causing this error?

var app = angular.module("app", ['ui.router', 'ngTouch', 'ngMaterial', 'ngMessages', 'ngAnimate'])

app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise('/category');

    $stateProvider
        .state('category', {
            url: '/category',
            templateUrl: '../../app/CategoryViewer/Category.html',
            controller: 'CategoryController'
        });
}]);
<head>
    <title></title>
    <link href="css/reset.css" rel="stylesheet" />
    <link href="https://ajax.googleapis.com/ajax/libs/angular_material/1.0.5/angular-material.min.css" rel="stylesheet" />
    <link href="css/site.css" rel="stylesheet" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>    
    <script src="https://code.angularjs.org/1.5.0/angular.min.js"></script>
    <script src="https://code.angularjs.org/1.5.0/angular-route.min.js"></script>
    <script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js"></script>
    <script src="https://code.angularjs.org/1.5.0/angular-touch.min.js"></script>
    <script src="https://code.angularjs.org/1.5.0/angular-messages.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.0.4/angular-material.min.js"></script>

    <script src="app/app.js"></script>
    <script src="app/directives.js"></script>
    <script src="app/CategoryViewer/CategoryController.js"></script>
</head>


<body ng-app="app">
    <div id="content" ui-view>hello</div>
</body>

Any help would be appreciated.

like image 821
Yehuda_Fievel Avatar asked Apr 26 '26 04:04

Yehuda_Fievel


1 Answers

this is an injection problem, either injection into your controller / service or your app.

try removing each of these one at a time, does the problem go away?

var app = angular.module("app", ['ui.router', 'ngTouch', 'ngMaterial', 'ngMessages', 'ngAnimate'])

once you can narrow it down it will be easier to fix. Do the logs say which module it is having problems injecting?

i cant see a script tag for ng-animate

like image 91
danday74 Avatar answered Apr 27 '26 20:04

danday74



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!