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
Post a Comment