A knockout subscribes to an observable array, but not to every observable within that array. If you want to subscribe to individual properties, you need to subscribe manually using myObservable.subscribe ()
A knockout subscribes to an observable array, but not to every observable within that array. If you want to subscribe to individual properties, you need to subscribe manually using myObservable.subscribe ()
Edit
If you are trying to calculate how much you should calculate, you can do it like this:
var allEmployees = ko.observableArray([my data goes here]); var Employees=ko.computed(function() { return ko.utils.arrayFilter(allEmployees(), function (emp) { return emp.active === true; }); });
This works if the active is not an observable property for all allEmployees (). If this is an observable simple change, so that -
var allEmployees = ko.observableArray([my data goes here]); var Employees=ko.computed(function() { return ko.utils.arrayFilter(allEmployees(), function (emp) { return emp.active(); }); });
source share