0
votes

I am using Durandal 2.0.1 for my application.

I am using below html code to compose view and viewmodel.

<div id="graphid" data-bind="compose: { model: 'templates/graphControl', view: 'templates/graphControl' }, visible: showGraph"></div>

The problem which I am facing is that, whenever I am trying to toggle the visibility of the above div, tryactivate is getting called again and again. Is it the expected behaviour or is there something I am doing wrong. Can anyone tell/explain why is this happening, if it is a known behaviour.

Can anyone just explain why is this happening.

Thanks in advance.

1
You're gonna need to post more code. If at all possible, a jsfiddle that reproduces your problem would be the most helpful.scaryman

1 Answers

1
votes

I had an issue similar to this last night. Based on your code, give the following a try

        <!--ko visible: showGraph-->
            <!--ko compose: { model: 'templates/graphControl', view: 'templates/graphControl' }--><!--/ko-->
        <!--/ko-->