I’m going through chapter 11 of the big nerd ranch front end dev guide and I’m having a problem. on the line this.$element.append(rowElement.this.$element) I get a can’t append to undefinded error and I don’t know why. I really need some help. the rest of the files are at [url]https://github.com/DanielSollis/coffeerun
[CODE](function (window) {
‘use strict’;
var App = window.App || {};
var $ = window.jQuery;
function CheckList(selector) {
if (!selector) {
throw new Error(‘no selector provided’);
}
this.$element = $(selector);
if (this.$element.length === 0) {
throw new Error(‘could not find element with selector: ‘ + selector);
}
}
CheckList.prototype.addRow = function(coffeeOrder) {
var rowElement = new Row(coffeeOrder);
this.$element.append(rowElement.$element);
};
function Row(coffeeOrder) {
var $div = $(‘<div></div>’, {
‘data-coffee-order’: ‘checkbox’,
‘class’ : ‘checkbox’
});
var $label = $(‘<label></label>’);
var $checkbox = $(‘<input></input>’, {
type: ‘checkbox’,
value: ‘coffeeOrder.emailAddress’
});
var description = coffeeOrder.size + ”;
if (coffeeOrder.flavor != ”) {
description += coffeeOrder.flavor + ”;
}
description += coffeeOrder.Coffee + ”;
description += ‘ (‘ + coffeeOrder.Email + ‘)’;
description += ‘ [‘ + coffeeOrder.strength + ‘x]’;
$label.append($checkbox);
$label.append(description);
$div.append($label);
this.$element = $div;
}
App.CheckList = CheckList;
window.App = App;
})(window);