Errata

AngularJS: Up and Running

Errata for AngularJS: Up and Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
ePub
3rd paragraph

The variable name in the text needs to be changed from "updateNameinUI" to "updateNameInUI".

Also in the description of my previous errata my auto form fill added 'Slovenia' instead of 'jQuery example code'.

Note from the Author or Editor:
Was a problem in the early release. Has been caught and fixed in the final release.

Should be updateNameInUI and not updateNameinUI

Ziga Miklic  Jun 13, 2014  Sep 05, 2014
PDF
Page xiii, 197
--

Wrong AngularJS version.
On PDF pages xiii and 197, AngularJS version should be v1.2.19, not v1.12.19.

Note from the Author or Editor:
Yup, good catch. Fixing it in the final release.

We are using AngularJS 1.2.19 and not 1.12.19

Tiago Oliveira  Aug 04, 2014  Sep 05, 2014
PDF
Page n/a
Across the entire text

"double-curly" (braces/syntax/notation) is written in an inconsistent way across the entire text. Sometimes is appears hyphenated, sometimes not.

Note from the Author or Editor:
Changed to "double curly" throughout, without hyphen.

Tiago Oliveira  Aug 21, 2014  Sep 05, 2014
Printed
Page 4
1st paragraph under the heading "The AngularJS Philosophy"

The paragraph begins:

"There are five core beliefs to which AngularJS subscribes..."

However, SIX subheadings subsequently appear:

- Data-driven (via data-binding)
- Declarative
- Separate your concerns
- Dependency Injection
- Extensible
- Test first, test again, keep testing

Note from the Author or Editor:
The reporter is correct. The statement should read:

"There are six core beliefs to which AngularJS subscribes..."

David Smith  Nov 30, 2014  Apr 02, 2015
ePub
Page 6
Slovenia

There is a missing singular quotation mark in the jQuery example:

var updateNameInUI = function(name) {
$('#name).text(name);
};

Note from the Author or Editor:
You are right.

It should be

$('#name').text....

Has been fixed in the final release.

Ziga Miklic  Jun 13, 2014  Sep 05, 2014
ePub
Page 11
Code Example LInk

The link to the sample code on git hub has the authors username as shyamse-shadri where is should be https://github.com/shyamseshadri/angularjs-up-and-running.

Note from the Author or Editor:
The problem is with the link to the github repository in certain screen sizes, where the text overflows to the next line with a hyphen for showing overflow. The link should not overflow or break inbetween and should be displayed in a single line.

Barry Mortenson  Nov 26, 2014  Apr 02, 2015
PDF
Page 56
Table 4-2

Table 4-2 lists type="date" as a Built-in Validator, however when I use it, Angular allows the form to be submitted with any value I supply.

Looking in the Angular docs, I see input[date] in the latest version (1.3.3 snapshot) but not in the 1.2.19 the book is based on.

https://docs.angularjs.org/api/ng/input/input%5Bdate%5D

The 'required' validator works, so I know some validation is happening.

Note from the Author or Editor:
The reporter is correct. The input type=date was only introduced in 1.3.0 series of AngularJS. THe 1.2.19 version of the AngularJS that the first edition of the book uses only has the input type=text and input type=email validators.

Wendy Smoak  Nov 17, 2014  Apr 02, 2015
ePub
Page 77
Checkboxes

In the example code regarding checkbox true and false values:
...
With Binding:
<input type="checkbox" ng-model='sport.selected' ng-true-value='YES' ng-false-value='NO'>

Looks like angular complains if you use just one set of quotemarks around the values. The following code works for me.

...
With Binding:
<input type="checkbox" ng-model='sport.selected' ng-true-value='"YES"' ng-false-value='"NO"'>

I'm using angular 1.3.x, so maybe something changed in the way angular evaluates those values nowadays.

Note from the Author or Editor:
The bindings has changed with AngularJS 1.3. This is being updated in the update for the book

Marcel Krause  Jan 21, 2015  Apr 02, 2015
PDF
Page 98
Last paragraph (excluding code)

This phrase: "A simple transformRequest that takes the JSON post data and converts it into jQuery like a post datastring is as follows" doesn't make sense. It should probably read "A simple transformRequest that takes the JSON post data and converts it into a query string is as follows".

Note from the Author or Editor:
The errata is correct as reported. The sentence should read as

" A simple transformRequest that takes the JSON post data and converts it into query string is as follows"

Victor Grigoriu  Jan 12, 2015  Apr 02, 2015
PDF
Page 106
Last paragraph

The paragraph says "In the next chapter, we will [...] use the core AngularJS ngRoute module to accomplish this.", but ngRoute is only introduced in chapter 10.

Note from the Author or Editor:
The reporter is correct. It should refer to the next chapter which is unit testing services and xhrs.

Victor Grigoriu  Jan 12, 2015  Apr 02, 2015
PDF
Page 107
Chapter 7

Although the Chapter 7 is entitled "Unit Testing Services and XHRs" the chapter does not cover unit testing services but controllers using services, as it occurs to me.

A proper description of how to unit test services would be of great value; especially the peculiarities of unit testing services created by .factory(...) or .service(...), including issues regarding DI ($http <-> $httpBackend).

Note from the Author or Editor:
Very valid observation. We are working on an update which covers this in depth.

Anonymous  Aug 09, 2014  Apr 02, 2015
PDF
Page 127
Figure 8-2

Line 3 has 'INR 1,024.00' instead of '£ 1,1024.00'

Note from the Author or Editor:
Confirmed. Image will be updated in the updated version.

Victor Grigoriu  Jan 14, 2015  Apr 02, 2015
PDF
Page 128
3rd paragraph on page (the sub-section 'string' under the section 'filter')

The text reads: "If provided a string expression, AngularJS will look for the string in the __keys__ of each object of the array..." - whereas this should really read something along the lines of: "...will look for the string __across all the keys__ of each object...".

In other words, it is actually the value corresponding to every key that is searched (for the string match) and not the keys themselves.

Note from the Author or Editor:
The error is correct as reported. The corrected paragraph should read:

If provided a string expression, AngularJS will look for the string across all the keys of each object in the array (that is, the string value will be checked against the value of each key in each object). If the value is present in any of the keys of an object, that object is included and displayed as part of the ng-repeat. The string can optionally be prefixed with a ! to negate the match.

Vidroha Debroy  Nov 05, 2014  Apr 02, 2015
ePub
Page 143
The unit test does not pass

The test in chapter 3 seems to require a download of the angular.min file, while all previous examples in the book refers to the cdn. There should atleast be a mention of the fact that the framework now needs to be downloaded before running the example. Also, on page 124 in the karma.conf.js a "simpleSpec.js" is specified to be loaded, but no such file is mentioned in the chapter and hence is missing when running the test.

To sum up: all previous code in the book is "copy and paste" while suddenly in chapter 3 it seems that the reader needs to start reading the code very carefully to get everything setup and working.

Note from the Author or Editor:
Chapter 3 should mention that it requires the angular.min.js and angular-mocks.js file to be downloaded and kept along in case you have not synced the Github repository. In the Running the unit test section, the following line needs to be added as a NOTE / TIP:

In case you have not cloned the Github repository, then you would need to manually download and save the angular.min.js and angular-mocks.js file in the folder with the karma.conf.js to run the tests.

Furthermore, the example in the Jasmine syntax section in chapter 3 is the simpleSpec.js file (Currently with the header // A test suite in Jasmine), which is not labelled correctly in the book. It needs the following comment added

// File: chapter3/simpleSpec.js

Lars Jacobsson  Sep 25, 2014  Apr 02, 2015
PDF
Page 201
First paragraph / First Sentence

The first sentence says, that Step 1 through 5 are exactly the same as in the previous example. But there is a difference in Step 4: the 'when-select' attribute is new in this second example. The Unit Test would not work without this attribute.

Note from the Author or Editor:
The reporter is correct. The statements needs to be updated to highlight the change in Step 4 as well.

Anonymous  Jan 18, 2015  Apr 02, 2015
PDF
Page 211 & 212
211, Paragraph after the "two-step" process; 212, first bullet-point

In the basic transclusion example, you first show three pieces that work together to create the directive (index.html, stock.html, and the directive.js). Then on page 211, it says "The controller and the index.html file remain unchanged from before, so we won’t repeat it." Below that, we actually find out that index.html did change, and that "(Recommended Stock : {{s.name}})" was added for basic transclusion example.

I'd recommend just showing the index.html code from the "directive-transclusion" folder along with the updated stock.html and directive.js, and then correct the sentence above, removing index.html, as it does change for the transclusion example.

Note from the Author or Editor:
The errata is correct.

The statement "The controller and index.html file remain unchanged should read"

The controller file remains unchanged. The index. html was updated as follows, and provide the updated index.html file code from the github repository. In particular, the text "This content will be blown away" in the index.html from the previous example becomes "Recommend Stock : {{s.name}}"

Josh Schneider  Dec 03, 2014  Apr 02, 2015
PDF
Page 227
last paragraph

The paragraph says "Our zipCode directive..." eventhough the directives name is "validZip".

Note from the Author or Editor:
The errata is confirmed. The sentence should read

"Our validZip directive defines a regular expression..."

Anonymous  Oct 28, 2014  Apr 02, 2015
PDF
Page 266
Serve a single JS file; 4th paragraph

"you can considering" should be "you can consider".

Tiago Oliveira  Aug 21, 2014  Sep 05, 2014