Knockout component with custom element not working similar to component binding
Using knockoutjs; I have a custom component that works when used as a component binding, but doesn't work when used as a custom element.
See the fiddler here: http://jsfiddle.net/fmgbfthq/4/
Why does it work as expected when using component binding but not when used as a custom item? Shouldn't this work exactly the same?
<!-- params.loads is coming in as a function -->
<metric params="value: loads()"></metric>
<!-- params.loads is coming in as a value -->
<div data-bind="component: {
name: 'metric',
params: {
value: loads()
}
}"></div>
+3
source to share