define(function (require) { var view = {}; view.View = function () { this.template = '
  • ' + '
    ' + '' + '' + '' + '
    ' + '
  • '; }; // Create a string of HTML
  • elements inside with the given // items. view.View.prototype.show = function (items) { var i, l; var view = ''; for (i = 0, l = items.length; i < l; i++) { var template = this.template; var completed = ''; var checked = ''; if (items[i].completed === 1) { completed = 'completed'; checked = 'checked'; } template = template.replace('{{id}}', items[i].id); template = template.replace('{{title}}', items[i].title); template = template.replace('{{completed}}', completed); template = template.replace('{{checked}}', checked); view = view + template; } return view; }; return view; });