The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mmcconnell (8) [Avatar] Offline
#1
-I'm new to angular but I had to make the following changes in order for the code to work.

Version: V8
Chapter 1
Page: 12

Angular Version Script Tag:
<script src="http://ajax.googleapis.com/ajax/libs/jquery <br /> /1.9.1/jquery.min.js"></script> 

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>  



AS-IS
...
<script>
angular.module('helloApp')
.controller('HelloCtrl', function ($scope) {;...
</script>

What I had to change
...
angular.module('helloApp', [])
.controller('HelloCtrl', ['$scope', function($scope) {


QualityCoder (1) [Avatar] Offline
#2
Are you minifying your javascript?

I believe that is the only case when you would need to do what you did with '$scope' and the array parameter vs just the function.

14207 (1) [Avatar] Offline
#3
I was having the same issue, and the fix mentioned worked.

I did use the minified version from the google CDN:
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script>

I think you should make sure that the example works with minified angular. The text says to "try running the example yourself". However, the preferred method for loading angular hasn't been specified yet. IMHO loading from the CDN is a natural first step so a lot of people might face the same issue.

Thanks...