0

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.

Ankur
  • 730
  • 7
  • 28
  • You're gonna need to post more code. If at all possible, a jsfiddle that reproduces your problem would be the most helpful. – scaryman Oct 25 '13 at 15:02

1 Answers1

1

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-->
  • Even I have solved in somewhat similar manner. I have solved this issue by by toggling the visibility of the above div(div above
    ) I want to know why is this happening?? when we are using visible in the same div.
    – Ankur Oct 29 '13 at 13:47
  • Well im not sure for the exact reason but if you check the documentation, it dosent mention visible as a valid property for the compose binding. – Jamie Hammond Oct 31 '13 at 16:02