编写单例的 dojo class

define([
"dojo/_base/declare"
],function(
declare
){
var TimeChartService = declare("Service.TimeChartService",[],{
constructor:function(){

},

someOtherFunctions:function(){

}
});

if(!TimeChartService._instance){
TimeChartService._instance = new TimeChartService();
}

return TimeChartService._instance;
});

posted on 2014-07-23 10:45  yoyo002  阅读(262)  评论(0)    收藏  举报