In testing the app in chapter 22, I noticed that the web service uses f-name and l-name instead of fname and lname as shown in the code. Sigh. Why would you do that?
Anyway, to get the data to show up as shown in Figure 22.3, you have to change the model in witness.js to:
export default DS.Model.extend({
‘f-name’: DS.attr(‘string’),
‘l-name’: DS.attr(‘string’),
email: DS.attr(‘string’),
sightings: DS.hasMany(‘sighting’),
fullName: Ember.computed(‘f-name’, ‘l-name’, function() {
return this.get(‘f-name’) + ’ ’ + this.get(‘l-name’)
})
});