-
21 Sep 2012 1:06 PM #1
Global Variables / Environment Variables
Global Variables / Environment Variables
I am looking for some type of environment variables, but not sencha's definition of them. Typically environment would be development, staging, production...
I have tried a few different ways to setup global variables so I can change my dev links to production links without going threw all the code. Everything works fine until I try to deploy the app, then I get undefined errors for all those variables.
Does anyone know the best way to do this?
-
21 Sep 2012 9:15 PM #2
-
22 Sep 2012 3:58 AM #3
-
22 Sep 2012 8:54 AM #4
Copy info:
You could create an external Utils.js in your app dir that contains your unique set of functions.
Utils.js
In your app.jsCode:Ext.define('MY.Utils', { singleton : true, .. });
In your controller:Code:Ext.application({ name : 'MY', autoCreateViewport : true, requires: [ 'MY.Utils' ], controllers : [ 'main' ] });
Scott.Code:var myvalue = MY.Utils.someFunction();
-
22 Sep 2012 10:37 AM #5


Reply With Quote