abuiles / ember-cli-101-errata

18 stars 4 forks source link

Page 113: snippet lacks indication that previous content should be retained #186

Open kbjorklid opened 9 years ago

kbjorklid commented 9 years ago

This snippet on page 113 of app/controllers/articles/index.js lacks indication that the previous content of the class should not be removed:

import Ember from 'ember';
export default Ember.Controller.extend({
    contentDidChange: function() {
        console.log('Called when we add or removed an article.');
    }.observes('model.[]'),
    stateDidChange: function() {
        console.log('Called when the state property change for any of the articles.'\
                   );
    }.observes('model.@each.state')
});

The previous content includes the following properties:

  queryParams: ['show'],
  possibleStates: ['borrowed', 'returned'],

...which must be retained for the code to work. That is, these two lines should be added to the snippet on page 113.