View class that extends the jQuery prototype.
Extending classes must implement a @content
method.
class Spacecraft extends View
@content: ->
@div =>
@h1 'Spacecraft'
@ol =>
@li 'Apollo'
@li 'Soyuz'
@li 'Space Shuttle'
Each view instance will have all the methods from the jQuery prototype available on it.
craft = new Spacecraft()
craft.find('h1').text() # 'Spacecraft'
craft.appendTo(document.body) # View is now a child of the <body> tag
Add the given subview wired to an outlet with the given name
Argument | Description |
---|---|
|
String name of the subview |
|
DOM element or jQuery node subview |
Add a text node with the given text content
Argument | Description |
---|---|
|
String text contents of the node |
Add a new tag with the given name
Argument | Description |
---|---|
|
String name of the tag like ‘li’, etc |
|
other arguments |
Add new child DOM nodes from the given raw HTML string.
Argument | Description |
---|---|
|
String HTML content |