InnerText now supports functions.
This commit is contained in:
parent
6c9ecaf37a
commit
b981d8f7c1
@ -433,7 +433,7 @@ class IgniteTemplate {
|
||||
|
||||
/**
|
||||
* Sets the inner text of the element to be constructed by this template.
|
||||
* @param {String|IgniteProperty|IgniteProperty[]} value text to be set for this element. If a property is passed the text will auto update.
|
||||
* @param {String|IgniteProperty|IgniteProperty[]|Function} value text to be set for this element. If a property is passed the text will auto update.
|
||||
* @param {Function} converter Optional function that can be used to convert the value if needed.
|
||||
* @returns This ignite template.
|
||||
*/
|
||||
@ -468,8 +468,10 @@ class IgniteTemplate {
|
||||
});
|
||||
|
||||
this._elementInnerText = converter(...value.getPropertyValues());
|
||||
} else if (value instanceof Function) {
|
||||
this._elementInnerText = converter ? converter(value()) : value();
|
||||
} else {
|
||||
this._elementInnerText = (converter != null ? converter(value) : value);
|
||||
this._elementInnerText = converter ? converter(value) : value;
|
||||
}
|
||||
|
||||
IgniteRenderingContext.pop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user