如果将可观察对象中包含的可观察属性传递给自定义组件,则看起来它会重新包装在新的可观察对象中。当你在observable上有一个扩展名时就会出现问题。
演示:http://jsfiddle.net/jaytre/0exas0ug/
<div id='main'>
<foo-check params="value: fooVal"></foo-check> <!-- works -->
<foo-check params="value: outerVal.fooVal"></foo-check> <!-- works -->
<foo-check params="value: outerObsrvVal().fooVal"></foo-check> <!-- doesn't work, fooVal gets re-wrapped in new observable -->
</div>
它是KnockoutJS中的错误还是这种预期的行为?