Skip to content
View engine for Titanium based on Handlebars
JavaScript Java Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
modules/android
.gitignore
.jshintrc
Makefile
Readme.md
index.js
package.json

Readme.md

earp.js

earp.js is a template engine for Titanium

Philosophy

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

It's based on :

  • Titanium API
  • Handlebars

Install

You can install earpjs with tipi :

$ tipi install earpjs

Getting started

1. Create a hello.rp file in your Resources folder and copy/paste this :

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

2. Fill your app.js with this :

var Earp = require('tipis/Earp');

var hello = Earp.render('app/view/index.rp', {text: 'Hello World !'});

Earp('#foobar', hello).addEventListener('click', function() {
    alert('Button clicked');     
});

Earp('#win', hello).open();
Something went wrong with that request. Please try again.