Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

earpjs

IsCoolEntertainment2BSD-2-Clause0.0.2

Layout manager for Titanium based on Handlebars

mustache, handlebars, titanium, earp

readme

earp.js

earp.js is view engine for Titanium

Philosophy

With earp.js you will describe your views in XML and Handlebars syntaxes.

It's based on :

  • Titanium API
  • Handlebars

Getting started

1. Add earp.js in your Resources folder

2. Create a hello.earp file in your Resources folder and copy/paste this :

<window backgroundColor="white">
    <label top= "20%" left="50%" text="{{text}}" />
    <button top= "50%" left="50%" id="foobar" title="click here !" />
</window>

3. Fill your app.js with this :

var Earp = require('earp');

var dialog = Earp.build('hello', {text: 'Hello World !'});

dialog.get('foobar').addEventListener('click', function() {
    alert('Button clicked');     
});

dialog.open();