当我在 Mozilla 中运行我的程序时,它会解析剔除表达式并显示可观察数组中的值。当我在 IE7 中执行相同操作时,它会显示敲除代码。
Mozilla 结果
value 1
value 2
value 3
IE7 结果
function observable() {
if (arguments.length > 0) {
// Write
// Ignore writes if the value hasn't changed
if ((!observable['equalityComparer']) || !observable['equalityComparer'](_latestValue, arguments[0])) {
observable.valueWillMutate();
_latestValue = arguments[0];
if (DEBUG) observable._latestValue = _latestValue;
observable.valueHasMutated();
}
return this; // Permits chained assignments
}
else {
// Read
ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
return _latestValue;
}
}
我怎样才能使它在 IE7 中正常工作?