Embarking on a tutorial journey to dive into Angular setup.
Facing a persistent error in my code...
Error: [$injector:undef] http://errors.angularjs.org/1.6.0/$injector/undef?p0=Bear
Listing the order of files within the <head>
tag in the html
<script src="js/services/BearService.js"></script>
<script src="js/controllers/BearCtrl.js"></script>
<script src="js/app.js"></script>
Giving an insight into my BearService.js file...
angular.module('BearService', []).factory('Bear', ['$http', function($http) {
// some code (is this relevent?)
}]);
Diving into my BearCtrl.js file...
angular.module('BearCtrl', []).controller('BearController', ['$scope','Bear', function($scope, Bear) {
}]);
Reviewing my app.js file...
angular.module('sampleApp', ['ngRoute', 'appRoutes', 'MainCtrl','BearService', 'BearCtrl']);
Revision note: Experimented with changing the file call orders in the HTML document to troubleshoot, but no luck yet.