I've been searching diligently for a solution to this issue, but it appears to be quite unique in every instance. Perhaps fresh perspectives can help illuminate the problem.
An error message is appearing in my console:
app.js:23 Uncaught ReferenceError: angular is not defined
While my angular application is functioning properly, this error persists despite all attempts to fix it. I suspect the error arose when I restructured my code to align with a style guide authored by Todd Motto. Here is a snippet of my app.js:
(function() {
function config($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'partial/main'
})
.when('/assignment/:id', {
templateUrl: 'partial/assignment',
controller: 'SubmissionController'
}).otherwise({
redirectTo: '/'
});
}
angular
.module('myApp', ['ngRoute', 'ui.materialize', 'ngAnimate'])
.config(config);
})();
The dependencies are listed below:
doctype html
html(ng-app="myApp")
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0")
title= title
link(rel='icon', type='image/png', href='favicon.ico')
// bower:css
link(rel='stylesheet', href='../bower_components/animate.css/animate.css')
// endbower
script(src='js/app.js') styles
link(rel="stylesheet", href="css/app.css")
link(href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet")
body(ng-controller="AssignmentController")
block content
//- lib js
// bower:js
script(src='../bower_components/jquery/dist/jquery.js')
script(src='../bower_components/angular/angular.js')
script(src='../bower_components/Materialize/bin/materialize.js')
script(src='../bower_components/angular-route/angular-route.js')
script(src='../bower_components/angular-animate/angular-animate.js')
script(src='../bower_components/angular-materialize/src/angular-materialize.js')
// endbower
//- app js
script(src='js/app.js')
script(src='js/controllers.js')
script(src='js/services.js')
script(src='js/directives.js')
script(src='//localhost:35729/livereload.js')
After several trials and errors, I have attempted removing each dependency individually. I have also experimented with changing the loading order of dependencies and the sequence of application-specific files, yet the issue persists.
Any thoughts or suggestions on how to resolve this?