knockout.js - Knockout Durandal compose view $root access -


i using hot spa template (which uses knockout , durandal) display on screen. html code getting long i'm trying split , dice smaller reusable components.

the code renders find , shows expect to. seem have lost handle main viewmodel

from main view, tried

<!-- ko if: --> <!--ko compose: { model: $data, view: '../tmpl/a'} --> <!--/ko--> <!--/ko--> 

in tmpl/a.html file, have following:

         <!-- ko foreach: array -->             <!--ko compose: { model: $data, view: '../tmpl/tmpl1'} -->             <!--/ko-->             <!--/ko--> 

now within /tmpl/tmpl1 tried bind button model

it nothing @ all. appears within /tmpl/tmpl1 can see array item. tried print out

<div data-bind="text: ko.tojson($data)"></div> <div data-bind="text: ko.tojson($root)"></div> 

both shows array item.

please advise can do.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -