goog.soy
Exported Functions
InjectedDataSupplier() → void
void
An interface for a supplier that provides Soy injected data.
convertToElement( templateResult, domHelper ) → Element
Element
Converts a processed 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.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
disableStubbingAtRuntime() → void
void
See above.
renderAsElement<ARG_TYPES>( template, templateData, injectedData, domHelper ) → Element
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.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
renderAsFragment<ARG_TYPES>( template, templateData, injectedData, domHelper ) → Node
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 the name of the method). Otherwise a document fragment is returned containing the rendered nodes.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
renderAsText<ARG_TYPES>( template, templateData, injectedData ) → string
string
renderElement<ARG_TYPES>( element, template, templateData, injectedData ) → void
void
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.
Parameters |
|
---|
renderHtml<ARG_TYPES>( element, templateResult ) → void
void
Sets the processed template 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.
Parameters |
|
---|
shouldStubAtRuntime() → boolean
boolean
A runtime control for whether a Soy template will be replaced with an Incremental DOM template. This is to allow teams to run a 3-arm experiment with the default being NOOP (IDOM not not loaded), A1 (IDOM and SoyJS code loaded), and A2 (A1 but code stubbed at runtime).
Parameters | None. | |
---|---|---|
Returns |
|
Exported Properties
Helper typedef for ij parameters. This is what soy generates.
StrictHtmlTemplate → function(?=, (IjData|Object<string, *>|null)=): goog.soy.data.SanitizedHtml
function(?=, (IjData|Object<string, *>|null)=): goog.soy.data.SanitizedHtml
Type definition for strict Soy HTML templates. Very useful when passing a template as an argument.
StrictTemplate → function(?=, (IjData|Object<string, *>|null)=): (string|goog.soy.data.SanitizedContent)
function(?=, (IjData|Object<string, *>|null)=): (string|goog.soy.data.SanitizedContent)
Type definition for strict Soy templates. Very useful when passing a template as an argument.
Type definition for text templates.
Compiler Constants
goog.soy.alwaysStub → boolean
boolean
A define to always stub SoyJS with Incremental DOM templates.
goog.soy.shouldStub → boolean
boolean
A define to control the behavior of SoyJS. If set to true, all Soy templates will check for the the presence of a stub template generated by Incremental Dom, and delegate to it if present. If it is set, then it delegates to the function instead.
This is a define because this adds a set amount of code per template to check for the stub.
Exported Interfaces
Exported Classes
Type Definitions
Helper typedef for ij parameters. This is what soy generates.