How would you translate this snippet of javascript to coffeescript? Specifically I\'m struggling with how to call .property()
on the function definition.
There are a couple ways to define computed properties. Here are examples of each:
MyApp.president = Ember.Object.create
firstName: "Barack"
lastName: "Obama"
fullName: (->
@get 'firstName' + ' ' + @get 'lastName'
).property('firstName', 'lastName')
MyApp.president = Ember.Object.create
firstName: "Barack"
lastName: "Obama"
fullName: Ember.computed(->
@get 'firstName' + ' ' + @get 'lastName'
).property('firstName', 'lastName')