I\'m learning how to write apps with NativeScript. I believe the best way to learn is by doing. For that reason, I\'m building a basic app.
In this app, I\'m trying
Use the global namespace. In your app.js, code:
var application = require("application"); application.mainModule = "main-page"; global.myVariable = 'some value'; application.start();
You can then use global.myVariable anywhere in your app.