miuosh miuosh - 1 month ago 17
AngularJS Question

Cannot find error: angular.js:38 Uncaught Error: [$injector:nomod]

Please help to resolve this error. I can't resolve this issue.

\layout\sidenav.controller.js

angular.module('app.layout', [])
.controller('SideNavController', SideNavController);

function SideNavController(){
var vm = this;
vm.name = "sideNav"
}


app.module.js

angular.module('app', [
/* AngularJS modules */
'ngMaterial',
'ngSanitize',
'ngAnimate'
/* app.feature modules */
'app.layout'
/* cross.app modules */

])
.config();


angular.js:38 Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.5.5/$injector/nomod?p0=app(…)(anonymous function) @ angular.js:38(anonymous function) @ angular.js:2070b @ angular.js:1994(anonymous function) @ angular.js:2068(anonymous function) @ app.config.js:1
app.module.js:7 Uncaught SyntaxError: Unexpected string
angular.js:38 Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.5.5/$injector/nomod?p0=app(…)(anonymous function) @ angular.js:38(anonymous function) @ angular.js:2070b @ angular.js:1994(anonymous function) @ angular.js:2068(anonymous function) @ app.run.js:1
angular.js:38 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=app&p1=Error%3A%20%…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A21%3A332)(…)(anonymous function) @ angular.js:38(anonymous function) @ angular.js:4587q @ angular.js:322g @ angular.js:4548bb @ angular.js:4470c @ angular.js:1746yc @ angular.js:1767ee @ angular.js:1652(anonymous function) @ angular.js:30863b @ angular.js:3166Qf @ angular.js:3456d @ angular.js:3444

\index.html

<!DOCTYPE html>
<html lang="en" >
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/stylesheets/style.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">

<!-- Angular Material style sheet -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
</head>
<body ng-app="app" ng-cloak>
<div ng-controller="SideNavController as vm">
<p>
{{vm.name}}
</p>
</div>


<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
<script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
<script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>

<!-- Angular Material Library -->
<script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-sanitize.min.js"></script>

<!-- My application -->
<script src="layout/sidenav.controller.js"></script>
<!-- <script src="layout/main-container.controller.js"></script> -->
<script src="app.config.js"></script>
<script src="app.module.js"></script>
<script src="app.run.js"></script>
</body>
</html>


\angular.config.js

angular.module('app')
.config(configure);

function configure() {

}


\angular.run.js

angular.module('app')
.run(runBlock);
function runBlock() {

}

Answer

You are missing a , after ngAnimate

angular.module('app', [
  /* AngularJS modules */
  'ngMaterial',
  'ngSanitize',
  'ngAnimate',
    /* app.feature modules */
  'app.layout'
  /* cross.app modules */

])