Binding to View Model

You can connect the page-instance to the view model using bind: someVar.

In this example the page is bound to the variable bindToVM. Another div is printing the HTML code of the page.

Start page

This page is bound to the variable bindToVM.

<div data-bind="page: {id: 'start', bind: bindToVM}">
    <h3>Start page</h3>

    <p>This page is bound to the variable <code>bindToVM</code>.</p>
</div>

<div>
    <div data-bind="text: getText(bindToVM)"></div>
</div>

where
{
    bindToVM: ko.observable(),
    getText: function(p) {
        return $(p().element).html();
    }
}