new View(options) -> View
Creates a new View.
| Option | Default | Description |
|---|---|---|
| url | loads the template from a file | |
| text | uses the provided text as the template. Example:new View({text: '<%=user%>'})
|
|
| element | loads a template from the innerHTML or value of the element. | |
| type | '<' | type of magic tags. Options are '<' or '[' |
| name | the element ID or url | an optional name that is used for caching. |
| cache | true in production mode, false in other modes | true to cache template. |
new View.config(options) -> undefined
Sets the defaults for Views
| Option | Default | Description |
|---|---|---|
| type | '<' | type of magic tags. Options are '<' or '[' |
| cache | true | true to cache template. |
new View(options).out() -> String
Returns the compiled view code source.
new View(options).render(object) -> String
Returns the view rendered with object.
new View(options).update( {element|id} [, {url|object} ] ) -> {Function|undefined}
Updates an element with the result of rendering. If no url or object is provided, update returns a function that takes an object that can be used to update the element.