I'm trying to implement SPA with HotTowel Template by John Papa. Is there a limitation on how many levels of ko compose I can do?
In the shell.html it calls
<!-- ko compose: { model: router.activeItem .... } --><!-- /ko -->
Within my active view, I try to embed another view, and then I tried to embed another view and so on.
In home.html.
<!-- ko compose: { model: $data, view: view1 } --><!-- /ko -->
In view1.html, I do
<!-- ko compose: { model: $data, view: view2 } --><!-- /ko -->
In view2.html, I do
<!-- ko compose: { model: $data, view: view3 } --><!-- /ko -->
Problem is View3 is not called.
I confirmed this in the Chrome debugger trace, view3 is never called. Is there a limitation in how many levels I can go? If so how can I get around this?
Thanks in advance.
Cheers
Michael
As you've now found out -you have to have a root element in your view (it explicitly states this in the Durandal docs):
The view has exactly one root element. Durandal requires this. If comments are found at the root, they will be removed. In the case where more than one root element is found, they will be wrapped in a div.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With