new TemplateSettings(tagStart, tagEnd)
Object that contains settings that are meant to be sent
to the module:dot.template method. On instantiation, RegExp objects
are created that are specific to its own TemplateSettings#tagStart
and TemplateSettings#tagEnd properties.
Parameters:
Name | Type | Description |
---|---|---|
tagStart |
string | Value to set TemplateSettings#tagStart property. |
tagEnd |
string | Value to set TemplateSettings#tagEnd property. |
- Since:
- 1.0
- Source:
- TemplateSettings.js, line 144
Properties:
Name | Type | Description |
---|---|---|
evaluate |
RegExp | Created from module:dot.templateSettings.evaluate |
interpolate |
RegExp | Created from module:dot.templateSettings.interpolate |
encode |
RegExp | Created from module:dot.templateSettings.encode |
use |
RegExp | Created from module:dot.templateSettings.use |
define |
RegExp | Created from module:dot.templateSettings.define |
conditional |
RegExp | Created from module:dot.templateSettings.conditional |
iterate |
RegExp | Created from module:dot.templateSettings.iterate |
brokenTag |
RegExp | Not specfied in module:dot.templateSettings because it is not a complete tag (hence the name... `brokenTag`). |
Namespaces
Members
-
filterVarname :Function
-
This function is invoked when accessing the TemplateSettings#varname property.
console.log(settings.varname) // Outputs 'it' settings.filterVarname = function (varname) { return 'newvarname'; }; console.log(settings.varname) // Outputs 'newvarname'
- Since:
- 1.0
- Default Value:
- null
- Source:
- TemplateSettings.js, line 182
-
previousMatches :Array
-
The previous matches returned when validating conditionals in TemplateSettings#validate.
- Since:
- 1.0
- Default Value:
- null
- Source:
- TemplateSettings.js, line 189
-
strip :boolean
-
Passed directly to module:dot.template method.
- Since:
- 1.0
- Default Value:
- false
- Source:
- TemplateSettings.js, line 218
-
<readonly> tagEnd :string
-
The end of the template tag which RegExp objects in this instance are created for.
- Since:
- 1.0
- Source:
- TemplateSettings.js, line 203
-
<readonly> tagStart :string
-
The beginning of the template tag which RegExp objects in this instance are created for.
- Since:
- 1.0
- Source:
- TemplateSettings.js, line 196
-
validationCode :int
-
The last code returned by TemplateSettings#validate.
- Since:
- 1.0
- Default Value:
- Source:
- TemplateSettings.js, line 251
-
<readonly> varname :string
-
Passed directly to module:dot.template method. Accessing this property may invoke the optional callback TemplateSettings#filterVarname.
- Since:
- 1.0
- Default Value:
- Source:
- TemplateSettings.js, line 227
-
varnameFiltered :string|Array.<string>
-
Cached value that is set after accessing the property TemplateSettings#varname, and the callback TemplateSettings#filterVarname is set.
- Since:
- 1.0
- Default Value:
- "it"
- Source:
- TemplateSettings.js, line 244
Methods
-
destroy() → {void}
-
Removes all instance properties.
- Since:
- 1.0
- Source:
- TemplateSettings.js, line 259
Returns:
- Type
- void
-
reset() → {TemplateSettings}
-
Removes properties that may have been set after instantiation.
- Since:
- 1.0
- Source:
- TemplateSettings.js, line 356
Returns:
this- Type
- TemplateSettings
-
validate(data) → {int}
-
Parameters:
Name Type Description data
string Any data that is meant to be run through module:dot.template - Since:
- 1.0
- Source:
- TemplateSettings.js, line 276
Returns:
The current value of TemplateSettings#validationCode- Type
- int