Errata

Angular: Up and Running

Errata for Angular: 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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
Printed Page CH2
CH2 From event binding to conclusion

<div class="stock-container">
<div class="name">{{stock.name + ' (' + stock.code + ')'}}</div>
<div class="price"
[class]="stock.isPositiveChange() ? 'positive' : 'negative'"> $ {{stock.price}}</div>

<button(click)="toggleFavorite($event)"
[disabled] = "stock.favorite"> Add to Favorite </button>


</div>

This compiles successfully but in chrome I get this error:
compiler.js:2426 Uncaught Error: Template parse errors:
Unexpected closing tag "button". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags ("

<button(click)="toggleFavorite($event)"
[disabled] = "stock.favorite"> Add to Favorite [ERROR ->]</button>


"): ng:///AppModule/StockItemComponent.html@6:51
at syntaxError (compiler.js:2426)
at DirectiveNormalizer.push../node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer._preparseLoadedTemplate (compiler.js:16217)
at compiler.js:16209

Anonymous  Feb 14, 2019 
Printed Page --
Chapters 8 and 9

Angela, Kristen, editors, or author Shyam Seshadri,

Hello. The release of Angular Up & Running in 2018 corresponded with the release of version 6 of the rxjs library, which was not backward compatible as far as Observables go. So, even as your book was being published, your support end-of-chapter coding examples for the Chapter 8 and Chapter 9 Exercises were becoming obsolete.

Do you have updates for these coding examples? Here’s my status:

With the help of stack overflow.com, I think I was able to successfully upgrade your outdated code for the Chapter 8 Exercise. But I am really struggling with updating the Chapter 9 code. Notice my 2 recent postings to stackoverflow.com, neither of which I have been able to resolve:

https://stackoverflow.com/questions/60775474/httpclient-get-call-is-returning-404-not-found-error
https://stackoverflow.com/questions/60780301/installing-backwards-rxjs-v5-as-opposed-to-rxjs-v6

It would be great if you could respond, either with code updates or to the postings or to me directly as if you were responding to the postings.

Thank you very much! Nice job on the book, by the way. Your contribution is going to be instrumental in my landing my next job in Northern Virginia.

Dale Francis
Developer (Angular wanna be?)
dalemfrancis@gmail.com
571-326-7227

Dale Francis  Mar 23, 2020 
Other Digital Version Preface
Online Resources

Under "Navigating this book" is says all the examples refer to AngularJS 5.0.0 when it should just be Angular. Also under "Online Resources" is says AngularJS developer when it should just be Angular developer.

Daniel Eisterhold  Oct 04, 2021 
3
chapter 3

Near the end of Chapter 3: Useful Built-In Angular Directives, the example of ngSwitch is given. A hypothetical example, though make it easy to understand, sometime makes it difficult to implement. Hence I am giving the change in the same source code which is used as an example in the book. I hope adding this piece of code in the book will help many other readers too.

Initial button code was

<button (click)="toggleFavourite($event, i )" >
Add to Favourite
</button>


Now this is changed by me to

<button (click)="toggleFavourite($event, i )" >
<div [ngSwitch] = "stock.favourite">
<div *ngSwitchCase= 'true' >
Add to Favourite
</div>

<div *ngSwitchCase= 'false'>
Remove from Favourite
</div>
<b *ngSwitchDefault> Missing My Favourite</b>
</div>
</button>

This change will toggle the "Add to Favourite" shown on the button face based on the stock.favourite.

Sanjay Mishra  Nov 25, 2019 
Printed Page 25
Middle of page

"This is, the attribute value is used to boostrap..."
It should be: bootstrap
"This is, the attribute value is used to bootstrap..."

Anonymous  Jul 16, 2018 
Printed Page 68
After the unordered list

The second sentence of the first paragraph after the unordered list says:
"We will cover these in "Change Detenction" on page 67. For now is good to understand..."

The sentence is at page 68 inside the mentioned sub-chapter.

Manuel  Oct 25, 2018 
Printed Page 86
code sample - second it(...) routine

The four lines:

appComponent.onToggleFavorite(new Stock('Test', 'TEST', 54, 55));
expect(appComponent.stock.favorite).toBeTruthy();
appComponent.onToggleFavorite(new Stock('Test', 'TEST', 54, 55));
expect(appComponent.stock.favorite).toBeFalsy();

... test the same input -- new Stock('Test', 'TEST', 54, 55) -- and expect different results and tests failed.

This code worked:

const stock = new Stock('Test', 'TEST', 54, 55)
appComponent.onToggleFavorite(stock);
expect(appComponent.stock.favorite).toBeTruthy();
appComponent.onToggleFavorite(stock);
expect(appComponent.stock.favorite).toBeFalsy();

Barry Huett  Mar 07, 2019 
Printed Page 256
Exercise Section

In Chapter 11, page 256, Exercise, the reader is instructed to "Install and run the server in the chapter11/exercise/server folder by running:"

npm i
node index.js

Following this, I can successfully compile the app from the Exercise/Starter folder of Terminal by running

'> ng serve --port 3000'

I attempt to launch the app from Chrome using this:

localhost :3000

This leads to a 404 not found errors:

zone.js:2935 GET http ://local host :3000/api/product?q= 404 (Not Found)

core.js:1440 ERROR HttpErrorResponse {headers: HttpHeaders, status: 404, statusText: "Not Found", url: "http ://local host :3000/api/product?q=", ok: false, …}

Stack Overflow was unable to advise and I didn't hear from my last "Submit Errata" post. Can you please advise. I have followed the instructions precisely and am completely stuck.

Thank you,

Dale Francis
dalemfrancis@gmail.com
571-326-7227

Dale Francis  Mar 26, 2020