Package()
.define('Main', {
print: function() {
console.log('hello world!');
}
}).run(function(cp) {
cp.Main.print();
});
inheritance example
Package('test1')
.define('Parent', function(cp) { return Package.Class.extend({
print: function() {
console.log('print by parent');
}
});});
Package('test2')
.use('test1.Parent')
.define('Child', function(cp) { return cp.Parent.extend({
print: function() {
console.log('print by child');
},
printByParent: function() {
this.SUPER.print.apply(this, arguments);
}
});});
Package()
.use('test2.Child')
.run(function(cp) {
var c = new cp.Child();
c.print();
c.printByParent();
});
show you how to use TransitManager to control page redirect.
show you how to implement an application like twitter use tupai.js.