Ciwan Ciwan - 1 year ago 72
AngularJS Question

Can't Get "Hello World" to work with Angular JS

I am trying to follow along a PluralSight course on AngularJS Fundamentals. The guy's code and mine is as follows:

<!DOCTYPE html>
<meta charset="utf-8" />
<title>Hello World</title>
<!--[if IE]>
<script src=""></script>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<h1 ng-controller="HelloWorldCtrl">{{helloMessage}}</h1>
<script src=""></script>

<script type="text/javascript">
function HelloWorldCtrl($scope) {
$scope.helloMessage = "Hello World";

Yet it works for him and does not for me! What am I doing wrong? Seems like a pretty simple setup to me, yet it isn't working for me. I am not getting Hello World, instead I get:


Any help would be greatly appreciated.

Answer Source

Add ng-app attribute inside your html tag. Like this: <html ng-app>.

Working example:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download