Skip to content

Instantly share code, notes, and snippets.

View tonylukasavage's full-sized avatar
💭
Learning to make games

Tony Lukasavage tonylukasavage

💭
Learning to make games
View GitHub Profile
@tonylukasavage
tonylukasavage / Profile.js
Last active January 4, 2016 00:28 — forked from timanrebel/Profile.js
This is essentially what Alloy is doing under the hood for you with backbone
var EVENTS = 'fetch change destroy';
var args = arguments || {};
// remove existing bindings to prevent unexpected behavior and memory leaks
$.user.off(EVENTS);
// add bindings to new model
args.user.on(EVENTS, function() {
$.name.text = args.user.get('name');
var test = require('com.test');
...
var testTwo = test.init();
var realView = testTwo.createView();
$.index.open();
function doClick(e) {
Ti.API.info(JSON.stringify(e));
}
var library = Alloy.Collections.book;
library.fetch();
Ti.API.info(JSON.stringify(library));
@tonylukasavage
tonylukasavage / index.js
Created September 14, 2012 21:04 — forked from kenhkan/index.js
exports.* does not effect on-screen elements
$.hide.addEventListener("click", function(e) {
// don't create a new instance, use the one the markup creates for you
// you when you use the <Require> tag.
//
// var views = Alloy.createController("views");
// views.hide();
$.views.hide();
});