我是使用 knockout2.1.0 进行淘汰赛的新手。我有一个外部 java 脚本文件,但在我的 html 文件中没有调用它。我无法理解。
我在我的 html 文件中添加了以下内容
<script src="Scripts/TestJavascript.js"></script>
JS文件
///<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());
谢谢。