I am looking for a simple way to connect the textContent of an HTML element to a data string. To achieve this, I have implemented the following:
<span id="currentDate" data-win-bind="textContent:Data.currentDateString"></span>
In the code snippet above, I define a namespace Data with
WinJS.Namespace.define("Data", {
currentDateString: currentDateString,
});
where currentDateString is set as:
var currentDateString = "Monday";
Afterwards, in the ready function of the page, I execute WinJS.Binding.processAll();. This successfully populates the HTML content with the designated string. However, when the string changes, the HTML does not automatically update. I believe there must be some event that needs to be triggered to reflect changes in the string. How can I approach this? Is there a straightforward method similar to using WinJS.Binding.List for list datasources?