I'm currently diving into the realm of javascript and angularjs, following along with the tutorials on .
After setting up a basic IntelliJ javascript project, I created two essential files:
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Angular App!</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="HelloWorld" ng-controller="MainCtrl">
<div>
{{test}}
</div>
</body>
</html>
and app.js
var app = angular.module('HelloWorld', []);
app.controller('MainCtrl', [
'$scope',
function($scope){
$scope.test = 'Hello world!';
}]);
However, I keep encountering "ReferenceError: angular is not defined" when trying to run the program. Despite my efforts, I haven't been able to solve this issue. Most recommendations suggest checking the order of script tag declarations, but I believe it's properly set in my case. Any guidance for a novice like me?