Last active
November 16, 2017 20:16
-
-
Save hansemannn/beedc9df656859a7ec6dc1cd25e549b4 to your computer and use it in GitHub Desktop.
Use ES6 in Appcelerator Titanium 6.2.0+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!