modelScope Object (default: "window")

The view model scope. By default, the views will try to resolve their models from the global scope (window).

Example

<div data-role="view" data-model="foo" data-bind="events: {init: onInit }">Bar</div>

<script>
new kendo.mobile.Application($(document.body), {
    modelScope: {
        foo: {
            onInit: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
                console.log(e);
            }
        }
    }
});
</script>### modelScope `Object` *(default: "window")*

The view model scope. By default, the views will try to resolve their models from the global scope (window).

Example

<div data-role="view" data-model="foo" data-bind="events: {init: onInit }">Bar</div>

<script>
new kendo.mobile.Application($(document.body), {
    modelScope: {
        foo: {
            onInit: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
                console.log(e);
            }
        }
    }
});
</script>
In this article