javascript - Cannot call method indexOf undefined -
i'm getting error, cannotcall method indexof 'undefined' when using ko utils array filter . . .
view model:
viewmodel.people = ko.mapping.fromjs(people); self.filter1 = ko.observable(); self.filteredsystem = ko.computed(function () { var filter1 = self.filter1(); return ko.utils.arrayfilter(viewmodel.people(), function (people) { return ((people.name.indexof(filter1) !== -1)); }); }, self);
because used mapping plugin, name
property going observable , have unwrap (people.name().indexof...
) value.
Comments
Post a Comment