Take the 2-minute tour ×  I have a container div bound using
knockout foreach binding:     <div id="foo" data-bind="foreach:
{ data: fooObservableArray, afterAdd: afterAdd}">        <div
data-bind="text: $data"></div>  In the afterAdd method of the
ViewModel:       self.fooObservableArray =
ko.observableArray([]);       self.afterAdd = function(element){
// make some changes to the DIV's text after it has been created
$(element).text( someNewValue() );  Value someNewCalculatedValue
is not appearing in fooObservableArray but is being displayed in
the UI.  Is knockout not observing the div's text property as it
would observe the value of a bound input?  What is the proper
way to apply an afterAdd modification to the text of the new div
element that has been created via the foreach binding?
share|improve this question add comment  1 Answer  You don't
need to be using jQuery to set the text value. Afteradd is a
function usually to do some advanced logic, you shouldn't need
that.  First chan