Appcelerator / Titanium - Are Javascript variables polluting the global scope in controller files? -


i'm new appcelerator , titianium alloy, , wandering how global scope works in controller javascript files.

it still best practice attach of variables single global object within these files? in lot of tutorials seems declaring variables quite common names right in file no closure of scope.

put global variables , functions in app/alloy.js:

 alloy.globals.mymodule = require("mymodule");   alloy.globals.myfunction = function(e){      // logic function  }; 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -