Thursday, 5 September 2013

knockout.js mapping plugin add function

knockout.js mapping plugin add function

Let's you I have the following code to map json object to model:
$.getJSON('{% url "api-planner-planner-list"
%}?format=json').then(function(data){
planner = data[0];
planner_model = ko.mapping.fromJS(planner);
ko.applyBindings(planner_model);
});
How do I add a test function to the model to work with data-bind="click:
test"??

No comments:

Post a Comment