Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Last active November 16, 2017 20:16
Show Gist options
  • Save hansemannn/beedc9df656859a7ec6dc1cd25e549b4 to your computer and use it in GitHub Desktop.
Save hansemannn/beedc9df656859a7ec6dc1cd25e549b4 to your computer and use it in GitHub Desktop.
Use ES6 in Appcelerator Titanium 6.2.0+
class Application {
constructor(cb) {
this.window = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({
title: 'Trigger'
});
btn.addEventListener('click', function() {
Ti.API.info('Hello world!');
});
this.window.add(btn);
}
open(cb) {
this.window.open();
cb('ES6 rocks!');
}
}
var app = new Application();
app.open((text) => {
alert(text);
});
@ajzuse
Copy link

ajzuse commented Nov 16, 2017

Hi man!

Awesome work, but i have questions about it.

How I configure my Titanium project to use ES6 without use Alloy? Have any how-to to make it working?

Thank you for advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment