Details

First name:

Last name:

Full name:

Friends ()

»ShopNameCart: Northwind ShopNameCart: Household items
»KnockOut! List Products By Category (local Parent Child Foreign Key View Model) KnockOut! Client Side Local Diffferent Model Source
»A jQuery menu/accordian Using KnockOut data Model
Below is declaring a Knockout ViewModel on the Heap rather than the Stack as in the code. It is a convience to instantiate the ko.observable() Brad Wilson - Web Stack Of Love uses the method above. He goes on to show a WebApi (see App_Start directory).
<p data-bind="text: firstName"></p>
<p data-bind="text: lastName"></p>
<input type="text" data-bind="value: firstName" />
<input type="text" data-bind="value: lastName" />

<script type="text/javascript" src="../Scripts/knockout-3.3.0.js"></script>
<script type="text/javascript">

    var KOviewModel = function () {
        var self = this;
        self.firstName = ko.observable("Bert");
        self.lastName  = ko.observable("Smith");
    };
    
    var viewModel = new KOviewModel();

    ko.applyBindings(viewModel);
</script>