xcdemon05 xcdemon05 - 29 days ago 4
AngularJS Question

Why is this easier-than-hello-world angularjs application not working?

I'm following a pluralsight tutorial to learn angularjs, and I'm already stuck on the first video.

The tutorial uses plunker, here is the link to my code: http://plnkr.co/edit/ogmlEyLuzX3UBK65qgjk?p=preview

<!DOCTYPE html>
<html>

<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>

<body ng-app>
<h1>Hello Plunker!</h1>
{{ 843 / 42 }}
</body>

</html>


I followed the instructions, clicked the button to add angularjs to my html doc (i.e. it just adds the link in the header and the ng-app to the body tag) but it is not working.

In the video, he types
{{ 843 / 42 }}
and it prints to the page 20.07.... whereas mine is just printing {{ 843 / 42 }}.

I can't start learning about angularjs until I figure out why my code is not working, but I can't figure out why my code is not working until I learn more about angularjs...

Answer

I was listening to the same video and I had the same issue. I started by using the latest angular js file.

I then tried to use the same angular js file he was using (as below) and then it worked fine.

https://code.angularjs.org/1.3.0-beta.5/angular.js