I am having issues with Knockout (v3.2) in IE8. Binding expressions such as
<div data-bind="text: $data.Property"></div>
-where Property
is an observable- causes the actual text of knockout's observable function to display instead of the value Property
is supposed to represent.
Looking at the specs (jasmine tests for knockout) I've found that they explicitly don't support text node bindings for IE < 9 (line 442) https://github.com/knockout/knockout/blob/master/spec/bindingAttributeBehaviors.js#L442
Adding parentheses seems to fix this for IE8 text: $data.Property()
but, the concern is: will that have an adverse effect in other browsers? My initial assumption is no for a number of common sense reasons but I'm wondering if anyone knows of workarounds for this or if adding parentheses is it?
UPDATE 1: Thank you all for the comments at this point. After further investigation it seems the issue is that there are duplicate javascript files being loaded.
More specifically, while others are duplicated too the duplicate knockout library is causing the ViewModel's observables to be a different instance meaning they are not properly unwrapped for display.
This was proven by adding a condition around the knockout library like what was suggested here: Stop IE from loading dynamically included script twice. Adding the condition made the preferred binding approach (dependent on knockout unwrapping observables) work in IE8.
None of the questions/answers I found so far will suffice in my circumstance so I'll be asking a new question about how to keep multiple knockout libraries from loading twice.
UPDATE 2: The new question is posted for those that would like to follow along: How to stop Knockout 3.2 library loading twice