I am not utilizing ngRoute or any Angular service that requires injection. I am injecting my own module and controller as necessary. However, I am still encountering the following error in the console:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=try&p1=Error%3A%20%…2015%2520experiments%2Fangulartrial%2Fjs%2Flib%2Fangular.min.js%3A21%3A163)
at angular.min.js:6
at angular.min.js:40
at r (angular.min.js:7)
at g (angular.min.js:39)
at db (angular.min.js:43)
at c (angular.min.js:20)
at Bc (angular.min.js:21)
at ge (angular.min.js:19)
at angular.min.js:315
at HTMLDocument.b (angular.min.js:189)
Code: Index.html:
<html ng-app="try" lang="En">
<head>
<title>Learn Angular 1.5</title>
<!-- <script src="./js/lib/jquery-3.1.0.min.js" charset="utf-8"></script> -->
<script src='./js/lib/angular.min.js'></script>
<script src='app.js'></script>
<script src='./js/app/blog-list.module.js'></script>
<script src='./js/app/blog-list.component.js'></script>
</head>
<body>
<div class='' ng-controller = 'BlogListController'>
</div>
</body>
</html>
app.js:
angular.module ('try', ['blogList'])
//This works when I declare the controller right here
// .controller('BlogListController', function(){
// console.log("Hello");
// })
blog-list.module.js
'use strict';
//simply declare the module here
angular.module('blogList', [
//inject dependencies
'BlogListController'
]);
blog-list.component.js
//declare the controllers, components etc on the module here
angular.module('blogList')
.controller('BlogListController', function(){
console.log("Hello");
});