i am learning MEAN from Thinkster.io and in the second step he shows the dummy hello world output on the screen. When I try to replicate that I get the following error:
$ node app
F:\nodeProjects\flapperNews\app.js:3
angular.module('flapperNews')
^
ReferenceError: angular is not defined
at Object.<anonymous> (F:\nodeProjects\flapperNews\app.js:3:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
My app.js is as follows:
angular.module('flapperNews', []).controller('MainCtrl', [
'$scope',
function($scope){
$scope.test = "Hello World";
}]);
and index.html goes like:
<!DOCTYPE html>
<html>
<head>
<title>My Angular App</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-app ="flapperNews" ng-controller="MainCtrl">
</body>
</html>
I have done some research on this error where the solution is to properly place the tag, but that doesn't solve the problem for me. Can somebody please explain what is that is missed here and how to start the server. Thanks