I change "hideSlide" to "show" and it is now a true boolean. I also renamed "header" to "title"
viewModel.slide4 = ko.computed(function () {
var s4 = this.slideTxt()[3];
return s4 ? ko.utils.arrayFilter(this.slideTxt(), function (item) {
return item.slideId == s4.slideId;
}) : this.slideTxt;
}, viewModel);
{
"slideTxt": [
{
"slideId": 100,
"title": "",
"slideContent": "",
"show": true
},
{
"slideId": 102,
"title": "Slide 2 Header",
"slideContent": "This is slide 2 text",
"show": true
},
{
"slideId": 103,
"title": "Slide 3 Header",
"slideContent": "This is slide 3 text",
"show": true
},
{
"slideId": 104,
"title": "Sister Insert Name",
"slideContent": "Please join us in welcoming Sister Insert Name. She comes from \"Insert place\" and enjoy's \"this and that\"",
"show": true
},
{
"slideId": 105,
"title": "Slide 5 Header",
"slideContent": "This is slide 5 text",
"show": true
},
{
"slideId": 106,
"title": "Slide 6 Header",
"slideContent": "This is slide 6 text",
"show": true
},
{
"slideId": 107,
"title": "Slide 7 Header",
"slideContent": "This is slide 7 text",
"show": true
}
],
"slide4": [
{
"slideId": 104,
"title": "Sister Insert Name",
"slideContent": "Please join us in welcoming Sister Insert Name. She comes from \"Insert place\" and enjoy's \"this and that\"",
"show": true
}
]
}
ko.contextFor($0).$root.slide4()
[Objectshow: trueslideContent: "Please join us in welcoming Sister Insert Name. She comes from "Insert place" and enjoy's "this and that""slideId: 104title: "Sister Insert Name"__proto__: Object__defineGetter__: function __defineGetter__() { [native code] }__defineSetter__: function __defineSetter__() { [native code] }__lookupGetter__: function __lookupGetter__() { [native code] }__lookupSetter__: function __lookupSetter__() { [native code] }constructor: function Object() { [native code] }hasOwnProperty: function hasOwnProperty() { [native code] }isPrototypeOf: function isPrototypeOf() { [native code] }propertyIsEnumerable: function propertyIsEnumerable() { [native code] }toLocaleString: function toLocaleString() { [native code] }toString: function toString() { [native code] }valueOf: function valueOf() { [native code] }get __proto__: function __proto__() { [native code] }set __proto__: function __proto__() { [native code] }