I'm starting to learn angularJS just now and i have a problem with my first controller.
This is my HTML:
<!DOCTYPE html>
<html ng-app="">
<head lang="en">
<title></title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script type="text/javascript" src="includes/main.js"></script>
</head>
<body>
<div ng-controller="firstCtrl">
<h1>{{data.message +" world"}}</h1>
<div class="{{data.message}}">
This is just a game!
</div>
</div>
</body>
</html>
and this is the javascript file main.js:
function firstCtrl ($scope){
$scope.data = {message: "Hello"};
}
in the tutorial im working with what im suppose to see its the Hello World message in the h1 but what i actually see its :
{{data.message +" world"}}
This is just a game!
this is the errors in console :
Error: [ng:areq] http://errors.angularjs.org/1.3.8/ng/areq?p0=firstCtrl&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:6:416
at Qb (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:19:417)
at sb (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:20:1)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:76:95
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:57:257
at s (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:7:408)
at v (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:57:124)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:52:9)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:52:26)
can someone help me figure out what it is?? i copied the exact code from the tutorial so i guess its something with my configuration but i have no clue what it is