locked
Design Question - use of "textContent" in data-win-bind expressions

    Question

  • Was digging into the binding expressions of the HTML/JS templates and became curious about why the phrase textContent is used, compared to other JS frameworks like jQuery and Knockout which use the phrase text.

    For example (using the Detail template as an example):

         <h1 class="pageTitle win-title" data-win-bind="textContent: item.group.title"></h1>

    To do a similar thing in Knockout would look like:

         <h1 class="pageTitle win-title" data-bind="text: group.title"></h1>

    Was this a conscious design decision? I'd love to see the Content part dropped, as it feels like unnecessary ceremony as far as I can see.

     

     

    Wednesday, October 26, 2011 1:50 AM

Answers