Skip to content

Instantly share code, notes, and snippets.

@rmosolgo
Created April 10, 2014 22:32
Show Gist options
  • Select an option

  • Save rmosolgo/10429154 to your computer and use it in GitHub Desktop.

Select an option

Save rmosolgo/10429154 to your computer and use it in GitHub Desktop.
Observe attributes of a batmanjs Batman.Model
class MyApp.Thing extends Batman.Model
constructor: ->
super
# Whenever someProperty changes, capitalized property will be updated
@observe 'someProperty', (newValue, oldValue) ->
@set('capitalizedProperty', newValue?.toUpperCase())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment