编写单例的 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  阅读(250)  评论(0编辑  收藏  举报