I want to use the same instance of "Data" from all my controllers and makes is global in alloy.js. It works fine in the simulator but on my device I get "Application Error: Couldn't find module: Data" at startup.
I'm using Titanium SDK 3.1.0.GA and Device iPhone 4S iOS 6.1.3.
Any suggestions?
alloy.js
var Data = require('Data'); Alloy.Globals.Data = new Data();
Data.js
var Data = function(){ this.string = 'Hello'; } Data.prototype.getString = function(){ return this.string; } Data.prototype.setString = function(string){ this.string = string; } module.exports = Data;