0
我想用Javascript Module Pattern
與Knockout JS and Pager JS
,我知道如何使用Javascript Module Pattern
和Knockout JS and Pager JS
分開,但我不知道如何整合them.Here是我的Javascript Module Pattern
如何使用Knockout JS和Pager JS來使用Javascript模塊模式?
var Module = (function(){
var my = {};
my.testMethod = function(){
alert("test method is called");
};
return my;
}());
(function(anyobj){
anyobj.anotherMethod = function(){
alert("another Method is called");
};
anyobj.testMethod();
}(Module));
代碼下面這段代碼工作找到,但我不知道如何整合,以便下面的代碼給定上面的代碼,使knockout js and pager js
做工精細用Javascript Module Pattern
var moduleViewModel = new Module();
pager.extendWithPage(moduleViewModel);
ko.applyBindings(moduleViewModel);
pager.start();