Skip to content

Instantly share code, notes, and snippets.

@sjltaylor
Forked from markevans/view_example.js
Created June 8, 2012 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sjltaylor/2896379 to your computer and use it in GitHub Desktop.
Save sjltaylor/2896379 to your computer and use it in GitHub Desktop.
Example use of a view, using the class stuff
define(['view'], function(View){
return View.sub('ItemView', function(){
this.domEvent('click', 'button', 'selected')
})
})
///////////////////////////////////////////////////////
define([], function(){
return Type('ItemView') // name is optional
.use(View) // this defines a static 'domEvent' function which I use below
.domEvent('click', 'button', 'selected')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment