Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
Created August 15, 2012 18:29
Show Gist options
  • Save tonylukasavage/3362168 to your computer and use it in GitHub Desktop.
Save tonylukasavage/3362168 to your computer and use it in GitHub Desktop.
var Alloy = require('alloy'),
Backbone = Alloy.Backbone,
_ = Alloy._,
A$ = Alloy.A;
function Controller() {
require('alloy/controllers/<%= parentController %>').call(this);
var exports = <%= exportsObj %>;
// exportsObj looks something like this:
// {
// foo: function(args) {},
// bar: function() {
// $.someLabelById.text = 'hi there'; // access to $ variable
// },
// customProp: 123,
// anotherFunc: function(args) {
// exports.bar(); // have to test if this will work
// }
// }
var $ = this;
<%= viewCode %>
<%= controllerCode %>
_.extend($, exports);
}
module.exports = Controller;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment