Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2013 07:25
Show Gist options
  • Save anonymous/5676240 to your computer and use it in GitHub Desktop.
Save anonymous/5676240 to your computer and use it in GitHub Desktop.
Kodepad Gist Share by gokmen on http://koding.com Author: http://gokmen.koding.com
class Timer extends JView
constructor:->
super cssClass: 'timer'
@setData secondsElapsed : 0
viewAppended:->
super
setInterval (@bound 'tick'), 1000
tick:->
@data.secondsElapsed += 1
@render()
pistachio:->
"Seconds elapsed: {{ #(secondsElapsed) }}"
appView.addSubView new Timer
.timer {
background-color : #eee;
width : auto;
height : auto;
padding : 10px;
margin : 20px;
border : 1px solid #ccc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment