thanks for reply and the link!
i've read the design decisions and now it's clear why and when a computed is used, but i didn't find a hint why it behaves different in
the component binding and the custom element! in case that the component binding is used, shouldn't be the implementation of how parameters passed to the component model
be the same?
yes,
unwrap is what i use right now as a workaround
i think in most cases i would not use a component model at all, because it is another design pattern which doesn't fit to the viewmodel pattern. (business model vs. gui model)
Instead of that approach i use a pattern, which i call "custom binding context":
1. abstraction of the behaviour into a model, for example a
LinearNavigation with next, prev, isFirst, isLast methods
2. data-bind="navi: { model: LinearNavigationModelOrInstance , data: objectOrWhatEverToNavigateOn }
3. expose api of the navigation model as context lets say $navi:
4. use the api on the new custom binding context
for example data-bind="click: $navi.next"
this pattern makes it easy to change the behaviour model
and it keeps the business model (viewmodel) free of gui logic.
greetings,
noirabys
greetings,
noirabys