<button data-bind="click: addAgent('John')">Add</button>Javascript:
// Overall viewmodel for this screen, along with initial state
function ReservationsViewModel() {
var self = this;
****some stuff deleted here****
self.addAgent = function(daname) {
self.seats.push(new SeatReservation(daname));
}
}This works, however on opening the page the addAgent function is called and John is passed to it. From the syntax this should only occur when the button is clicked - not just on loading?Any help would be great.(really love knockout.js btw!)Many thanks.