Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS simple "Hello, world" not working

Tags:

Trying to follow a tutorial, I can't get the "Hello, world" example working. Instead it displays: "{{greeting.text}}, world". Using Chrome and AngularJS 1.3.1.

index.html:

<!DOCTYPE html> <html ng-app>     <head>         <script src="angular.js"></script>         <script src="app.js"></script>         <!--<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />-->     </head>     <body>         <div ng-controller='HelloController'>             <p>{{greeting.text}}, world </p>         </div>     </body> </html> 

app.js

function HelloController($scope) {     $scope.greeting = { text: 'Hello' }; } 

My folder structure

root/     angular.js     app.js     index.html 

Thank you