Constructor
new Txt(data)
Parameters:
Name | Type | Description |
---|---|---|
data |
iTxtConstructor |
Object with parameters. |
Extends
Methods
(static) value(value, placeholders)
Value To replace placeholders in text.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
String of text. |
placeholders |
Array.<string> |
List of placeholders if it need to replace "{index}" |
addListener(value) → {void}
Add new event listener
Parameters:
Name | Type | Description |
---|---|---|
value |
Listener |
Listener object |
- Overrides:
- Source:
className(value) → {string}
Get/Set style-classes
Parameters:
Name | Type | Description |
---|---|---|
value |
String |
To set new string of style-classes |
- Overrides:
- Source:
html(value, placeholders)
html To get/set string of html.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | undefined |
String of html. |
placeholders |
Array.<string> | undefined |
List of placeholders if it need to replace "{index}" |
Example
txt.html("<b>Old text string</b>: empty");
txt.html("<b>New text string</b>: {0}", ["Example"]);
listen(name, cb, after) → {Listener}
To listen event from this component
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
Name of event |
cb |
function |
Callback for fired event |
after |
boolean |
For phase before changes if "false" (by default) or after changes if "true" |
- Overrides:
- Source:
removeListener(value) → {void}
To remove installed event listener
Parameters:
Name | Type | Description |
---|---|---|
value |
Listener |
Listener object |
- Overrides:
- Source:
removeListeners() → {void}
To remove all installed event listeners
- Overrides:
- Source:
text(value, placeholders)
Text To get/set string of text.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | undefined |
String of text. |
placeholders |
Array.<string> | undefined |
List of placeholders if it need to replace "{index}" |
trigger(value) → {Action}
To fire event
Parameters:
Name | Type | Description |
---|---|---|
value |
Action | string |
Action object |
- Overrides:
- Source: