Skip to content

Instantly share code, notes, and snippets.

@marcmartino
Created June 28, 2012 23:28
Show Gist options
  • Save marcmartino/3014698 to your computer and use it in GitHub Desktop.
Save marcmartino/3014698 to your computer and use it in GitHub Desktop.
question with proto inheritance
var uiElement = {
compiledTemplate: undefined,
template: undefined,
toHTML: function(newTemplate) {
if (typeof this.compiledTemplate !== 'function' || newTemplate) {
this.compileTemplate(newTemplate || this.template);
}
return this.compiledTemplate(this.toObjectLiteral);
},
compileTemplate: function(newTemplate) {
if (typeof newTemplate === 'string') {
this.template = newTemplate
}
compiledTemplate = _.template(this.template);
}
}
var note = {
instructor: {},
user: {},
course: {},
session: {},
date: undefined,
firstViewDate: undefined,
note: undefined,
domReference: undefined,
showNote: function() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment