I am new to knockout using knockout2.1.0.
I have an external java script file, but it is not called in my html file. I can not understand.
I have added the following in my html file
<script src="Scripts/TestJavascript.js"></script>
JS File
///<reference path="~/Scripts/jquery-1.8.1.min.js">
///<reference path="~/Scripts/knockout-2.1.0.debug.js">
$(function AppViewModel() {
this.firstName = ko.observable("rash");
this.lastName = ko.observable("Bertington");
this.fullName = ko.computed(function(){
return this.firstName() + " " + this.lastName();
}, this);
})
ko.applyBindings(new AppViewModel());
thanks.
You aren’t creating a ViewModel. You are passing it to jquery.
Try