Errata: October 24, 2018

Thank you for purchasing Angular in Action . Please post any errors, other than those listed below, in the book's Author Online Forum. We'll update this list as necessary. Thank you!



Page 39, second paragraph following Figure 2.5:

Replace the second sentence, "We had to create the src/app/components directory first, because the CLI doesn't make new folders for you automatically if they're missing" with the following: "The CLI will make new folders for you automatically if they're missing."

The CLI will generate a new component inside the src/app/components/summary directory. The CLI will make new folders for you automatically if they're missing. This helps organize the components into a single directory, though you could choose to generate them elsewhere.

Page 71:

Replace the code snippet at the end of the page with the following:

<!-- isActive() returns true or false in order to set active class -->
<h1 class="leading" [class.active]="isActive()">Title</h1>
<!-- Renders to the following -->
<h1 class="leading active">Title</h1>

Page 142, section 6.5:

In the first line of the second paragraph, add the phrase, HttpClientModule as follows:
HttpClient is part of its own module, HttpClientModule, so you have to make sure it's included in your project.

Add the following sentence to the end of the paragraph:
HttpClient is part of its own module, HttpClientModule, so you have to make sure its included in your project. Its part of the @angular/common package, which you've probably installed, but if not, use npm to install it. If you're using your own tooling and module loader, like SystemJS, you'll have to ensure it's aware of this module. In your AppModule, you'll import the HttpClientModule from the @angular/common/http module and add it to your module imports array as follows:

...
import { HttpClientModule } from '@angular/common/http';
// ...
  imports: [
    BrowserModule,
      HttpClientModule,
    BrowserAnimationsModule,
    ClarityModule,
  ],
...

Page 147, listing 6.8:

Line 14 is missing the { character at the end of the line.

export class StocksInterceptor implements HttpInterceptor {

In the LiveBooks edition, comments follow the code; disregard those comments.

Page 154, listing 6.11:

Lines 9 and 10 are the same; delete one.

> alert(message: string, type: string = 'info', autohide: number = 5000) {

Page 180 listsing 7.7:

Replace line 8 on page 155 with the following:

.subscribe((params: Query) => {