Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Main application instance
- */
- define(["dojo/_base/declare", "dojo/_base/config"], function(declare, dojoConfig) {
- "use strict";
- var AppSingletonClass = declare(null, {
- config: {},
- constructor: function () {
- this.config = dojoConfig.appConfig || {};
- console.debug("app config:", this.config);
- },
- run: function () {
- console.debug("app starting");
- this._initUI();
- // ....
- console.debug("app started");
- },
- _initUI: function () {
- // ....
- },
- doRefreshData: function(){
- require(["dojo/request"], function(request){
- request.post("app/hello", {
- // .....
- });
- }
- },
- doHello: function () {
- window.alert("hello");
- }
- });
- AppSingletonClass.getSingleton = function () {
- if (AppSingletonClass._singletonInstance === undefined || AppSingletonClass._singletonInstance === null) {
- AppSingletonClass._singletonInstance = new AppSingletonClass();
- }
- return AppSingletonClass._singletonInstance;
- };
- return AppSingletonClass.getSingleton();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement