InnerText now supports functions.
This commit is contained in:
		| @@ -433,7 +433,7 @@ class IgniteTemplate { | |||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Sets the inner text of the element to be constructed by this template. |      * 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. |      * @param {Function} converter Optional function that can be used to convert the value if needed. | ||||||
|      * @returns This ignite template. |      * @returns This ignite template. | ||||||
|      */ |      */ | ||||||
| @@ -468,8 +468,10 @@ class IgniteTemplate { | |||||||
|             }); |             }); | ||||||
|  |  | ||||||
|             this._elementInnerText = converter(...value.getPropertyValues()); |             this._elementInnerText = converter(...value.getPropertyValues()); | ||||||
|  |         } else if (value instanceof Function) { | ||||||
|  |             this._elementInnerText = converter ? converter(value()) : value(); | ||||||
|         } else { |         } else { | ||||||
|             this._elementInnerText = (converter != null ? converter(value) : value); |             this._elementInnerText = converter ? converter(value) : value; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         IgniteRenderingContext.pop(); |         IgniteRenderingContext.pop(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user