Skip to content

Instantly share code, notes, and snippets.

@brentonhouse
Forked from rblalock/alloy.js
Created April 25, 2014 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentonhouse/11297780 to your computer and use it in GitHub Desktop.
Save brentonhouse/11297780 to your computer and use it in GitHub Desktop.
Alloy.createWidget = function(id, name, args) {
Ti.Analytics.featureEvent("widget." + id, args);
return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);
};
Alloy.createController = function(name, args) {
Ti.Analytics.featureEvent("controller." + name, args);
return new (require("alloy/controllers/" + name))(args);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment