Home

# Library goog.soy

Function Summary
| `renderAsElement(?Function template, ?Object= opt_templateData, ?Object= opt_injectedData, ?goog.dom.DomHelper= opt_domHelper) ⇒ !Element` Renders a Soy template into a single node. If the rendered HTML string represents a single node, then that node is returned. Otherwise, a DIV element is returned containing the rendered nodes.

`renderAsFragment(?Function template, ?Object= opt_templateData, ?Object= opt_injectedData, ?goog.dom.DomHelper= opt_domHelper) ⇒ !Node`

Renders a Soy template into a single node or a document fragment. If the rendered HTML string represents a single node, then that node is returned (note that this is *not* a fragment, despite them name of the method). Otherwise a document fragment is returned containing the rendered nodes.

| `renderElement(?Element element, ?Function template, ?Object= opt_templateData, ?Object= opt_injectedData)` Renders a Soy template and then set the output string as the innerHTML of an element. It is recommended to use this helper function instead of directly setting innerHTML in your hand-written code, so that it will be easier to audit the code for cross-site scripting vulnerabilities.