In Master Detail sample on Durandal website, project.activate
function is invoked two times each time when I change project in dropdown list.
First activation is invoked in write
method of Activator
. Second activation is invoked in composition.bindAndShow
.
If I'm right, an obvious fix would be replacing (in index.html
) this
<!--ko compose: activeProject--><!--/ko-->
with this
<!--ko compose: { model: activeProject, activate: false }--><!--/ko-->
but Durandal documentation says in Using Composition > Additional Settings > Activate:
Note: If you are using an activator, it will control the activation call and you should not attempt to manipulate it via the compose binding.
So I shouldn't do that. What is a proper way to fix this?