Template source
Specializes Montage
Properties
-
expandParameters source
-
-
instantiateWithInstances source
-
-
setObjectMetadata source
-
Add metadata to specific objects of the serialization.
Methods
-
callDelegateMethod(name) source
-
This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"
Parameters:
Name Type Description namestring Inherited From: -
equals(anObject) → {boolean} source
-
Returns true if two objects are equal, otherwise returns false.
Parameters:
Name Type Description anObjectObject The object to compare for equality.
Inherited From: Returns: boolean
Returns
trueif the calling object andanObjectare identical and theiruuidproperties are also equal. Otherwise, returnsfalse. -
getExternalObjectsString(doc) → {Promise} source
-
Searches for an external objects file in a document and returns its contents if found.
Parameters:
Name Type Description docstring The document to search.
Returns: Promise
A promise to the contents of the objects file or null if none found.
-
getInlineObjectsString(doc) → {String|null} source
-
Searches for an inline objects string in a document and returns it if found.
Parameters:
Name Type Description docHTMLDocument The document with the objects string.
Returns: String | null
The objects string or null if not found.
-
getObjectsString(doc) → {Promise} source
-
Searches for objects in the document. The objects string can live as an inline script in the document or as an external resource that needs to be loaded.
Parameters:
Name Type Description docHTMLDocument The document with the objects string.
Returns: Promise
A promise for the objects string, null if not found.
-
initWithDocument(_document, _require) → {Promise} source
-
Initializes the Template with a document.
Parameters:
Name Type Description _documentHTMLDocument The document to be used as a template.
_requirerequire The require function used to load modules when a template is instantiated.
Returns: Promise
A promise for the proper initialization of the template.
-
initWithHtml(html, _require) → {Promise} source
-
Initializes the Template with an HTML string.
Parameters:
Name Type Description htmlHTMLDocument The HTML string to be used as a template.
_requirerequire The require function used to load modules when a template is instantiated.
Returns: Promise
A promise for the proper initialization of the template.
-
initWithModuleId(moduleId, _require) → {Promise} source
-
Initializes the Template with the HTML document at the module id.
Parameters:
Name Type Description moduleIdstring The module id of the HTML page to load.
_requirerequire The require function used to load modules when a template is instantiated.
Returns: Promise
A promise for the proper initialization of the template.
-
initWithObjectsAndDocumentFragment(objects, html, _require) → {Promise} source
-
Initializes the Template with Objects and a DocumentFragment to be used as the body of the document.
Parameters:
Name Type Description objectsObject A JSON'able representation of the objects of the template.
htmlDocumentFragment The HTML string to be used as the body.
_requirerequire The require function used to load modules when a template is instantiated.
Returns: Promise
A promise for the proper initialization of the template.
-
initWithRequire(_require) source
-
Initializes the Template with an empty document.
Parameters:
Name Type Description _requirerequire The require function used to load modules when a template is instantiated.
-
setDocument(doc) → {Promise} source
-
Uses the document markup as the base of the template markup.
Parameters:
Name Type Description docHTMLDocument The document.
Returns: Promise
A promise for the proper initialization of the document.
-
setInstances(instances) source
-
Sets the instances to use when instantiating the objects of the template. These instances will always be used when instantiating the template unless a different set of instances is passed in instantiateWithInstances().
Parameters:
Name Type Description instancesObject The objects' instances.
Generated from a4679af