Errata: 1st Edition

Chapter 24, page 445, Editing a Sighting

On the fifth line of the first code listing, there is a typo.

The line

{{moment-from model.sightin.sightedAt}}

Should be

{{moment-from model.sighting.sightedAt}}

Chapter 25, page 464, Actions Up

The first code listing instructs the reader to add

close=(action "removeAlert")

In Ember 2.4.3, the action helper doesn’t work for controller or route actions. Instead, use sendAction in the component, and set close=“removeAlert”

The correct page number is 288.

Chapter 11, page 236.

Could also work without the call method, as follows:

formHandler.addSubmitHandler(function (data) {
    myTruck.createOrder(data, myTruck);
    checkList.addRow(data, checkList);
});

Chapter 7, on page 157 and 158, in the section Custom Timing Functions
.detail-image-frame{
position : relative;
text-align: center

transition: transform 333m cubic-bezier(1, .06, .28, 1);

}

the transition time should be “ms” not “m”, as “m” will throw an error in Atom’s css linter and not render any transition at all in browser.
.detail-image-frame{
position : relative;
text-align: center

transition: transform 333ms cubic-bezier(1, .06, .28, 1);

}

Chapter 17, page 335, Adding the ChatMessage Class

The example call to the ChatMessage constructor is incorrect.
The = should be replaced with :

Specifically, this:

new ChatMessage({message: 'hello from the outside',
                 user='adele25@bignerdranch.com', timestamp=1462399523859});

should be:

new ChatMessage({message: 'hello from the outside',
                 user: 'adele25@bignerdranch.com', timestamp: 1462399523859});

this.chatForm.init((data) => {
let message = new ChatMessage({message: data});
socket.sendMessage(message.serialize());
});

Just a minor typo I came across in chapter 3 (page 44/45 - PDF version): Just before Figure 3.12 Prompting for a style rule the text instructs to make changes to the section elements.style in the Chrome DevTools. However, in Chrome (and the relevant screenshots), the section is called element.style (without the s)

1 Like

Chapter 25, page 261

alertType: null causes an error for me, since null is not a string and so cannot be capitalized. In our removeAlert() action, when removing an alert we reset the alertType to “success”, so I’ve done the same in my code, so the code added at the top of page 261 would be

alertMessage: null, alertType: "success", isAlertShowing: false

I could well be doing something wrong with sendAction but what got this working for me was as follows:
Insert action="removeAlert" instead of close=(action "removeAlert")
Then in app/components/flash-alert.js replace this.get('close')(); with just this.sendAction(); .

Now the message displays and hides as I’d expect.

I think there should be a class=“form-control” on the range input for Chapter 9 page 207. Adding this would make the form look like Figure 9.11

<input name=“strength” id=“strengthLevel” type=“range” value=“30” class=“form-control”>

In Chapter 6, document.querySelectorAll(THUMBNAIL_LINK_SELECTOR) was not working for me, it was returning NULL… I was using my own web site to host the content rather than the Browser-Sync package. It turns out I needed to add:

document.addEventListener(“DOMContentLoaded”, function(event) {
Initialize();
});

in order to wait for all of the HTML to finish loading. It isn’t really a bug, but I learned a lot trying to sort out the issue.

thanks

On page 285, chapter 14, section Using Deferreds with Callback-Only APIs, the first paragraph says:

… It should use the allData object…

It should be:

… It should use the orders object…

And the next paragraph should also use orders instead of allData.

On page 448 - route actions - the create action function(data) should be just function(), shouldn’t it?

create() {
var self = this;
this.get(‘sighting’).save().then(function(data) {
self.transitionTo(‘sightings’);
});
}

On page 424, chapter 23, sentence below Figure 23.2.

The conditional statement evaluated the truthy value of the empty string for the last sighting instance.

should be

The conditional statement evaluated the falsy value of the empty string for the last sighting instance

Hi thomas1986!

Thanks for letting us know.
One question, can you confirm that your <script> tags appear just before the closing </body> tag? That is, after all of your other markup.

Listening for DOMContentLoaded should only be necessary if your <script> tags appear before your markup (such as in the <head>).

class="form-control" should not be needed. When I add that class, it adds extra padding and a border (among other styles).

Here’s the styling for that element without the additional class:

And here’s the styling for that element with the additional class:

When you get a chance, would you mind double checking?
Thanks!

I missed putting the script reference at the end. It tells me that on page 105. Thanks for the help.

In Ember 2.4.6, close=(action "removeAlert") is working for me in the application template.

I am getting a $ is not a function error for this one. Any suggestions ?