Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (44 sloc) 1.723 kB
<!DOCTYPE html>
<title>Hello Batman</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<link rel="stylesheet" href="resources/reset.css" type="text/css">
<link rel="stylesheet" href="resources/hello.css" type="text/css">
<script src="../lib/coffee-script.js"></script>
<script src="../lib/es5-shim.js"></script>
<script src="../lib/batman.js"></script>
<script src="../lib/batman.solo.js"></script>
<div id="container">
<h1 data-mixin="animation" data-hideif="person.hasName">Please enter your name</h1>
<form class="span-12">
<label>First Name</label><br />
<input class="title" type="text" data-bind="person.firstName" />
<label>Last Name</label><br />
<input class="title" type="text" data-bind="person.lastName" />
<h2 data-showif="person.hasName" data-mixin="animation">Hello, <span data-bind="person.fullName"></span></h2>
<button data-bind-disabled="person.hasName | not" data-event-click="person.reset">Reset</button>
<script type="text/coffeescript">
class Hello extends Batman.App
class Person extends Batman.Model
@accessor 'fullName', -> "#{@get('firstName') or ''} #{@get('lastName') or ''}"
@accessor 'hasName', -> @get('firstName') or @get('lastName')
reset: =>
@set 'firstName', ''
@set 'lastName', ''
Hello.person = (new Person()).reset()
Jump to Line
Something went wrong with that request. Please try again.