more Template work

This commit is contained in:
David Greenspan
2012-08-28 13:10:41 -07:00
parent bdb89d8c55
commit 2fd4e4c5c1
3 changed files with 33 additions and 6 deletions

View File

@@ -947,12 +947,33 @@ Example:
<h2 id="templates_api"><span>Templates</span></h2>
{{> api_box tmpldecl}}
A template that you declare as `<{{! }}template name="foo"> ... </{{! }}template>`
can be accessed as the function `Template.foo`.
XXX Describe `data` arg, calling it to get HTML. Each template may have many
occurrences (/instances/invocations) on the page. There are callbacks and
directives you can specify on a template declaration that apply to all
instances of the template. Templates have a life cycle. There are template
instance objects.
{{> api_box tmpldecl_rendered}}
{{> api_box tmpldecl_created}}
{{> api_box tmpldecl_destroyed}}
* XXX bind, preserve, events, helpers, ...
* XXX Template instance object
* XXX constant
* XXX link to Handlebars wiki page?
* XXX Remove Meteor.ui.render, all references
* XXX Add Meteor.render, Meteor.renderList
* XXX Create Spark-only wiki page
* XXX Mention Spark in template docs?
* XXX Find home for all relevant material on New Template API wiki page
<h2 id="meteor_ui"><span>Meteor.ui</span></h2>
`Meteor.ui` provides building blocks for creating reactive UIs out of strings of

View File

@@ -828,6 +828,13 @@ Template.api.http_del = {
descr: ["Send an HTTP DELETE request. Equivalent to `Meteor.http.call(\"DELETE\", ...)`. (Named `del` to avoid conflict with JavaScript's `delete`."]
};
Template.api.tmpldecl = {
id: "tmpldecl",
name: "Template.<em>myTemplate</em>([data])",
locus: "Client",
descr: ["Access a template function by name."]
};
Template.api.tmpldecl_rendered = {
id: "tmpldecl_rendered",
name: "Template.<em>myTemplate</em>.rendered = function ( ) { ... }",

View File

@@ -145,12 +145,11 @@ var toc = [
],
{name: "Templates", id: "templates_api"}, [
{prefix: "Template", instance: "myTemplate",
name: "rendered", id: "tmpldecl_rendered"},
{prefix: "Template", instance: "myTemplate",
name: "created", id: "tmpldecl_created"},
{prefix: "Template", instance: "myTemplate",
name: "destroyed", id: "tmpldecl_destroyed"}
{prefix: "Template", instance: "myTemplate", id: "tmpldecl"}, [
{name: "rendered", id: "tmpldecl_rendered"},
{name: "created", id: "tmpldecl_created"},
{name: "destroyed", id: "tmpldecl_destroyed"}
]
],
"Meteor.ui", [