|
|
|
|
|
by klibertp
4865 days ago
|
|
You're wrong. The 'property' is a method on the Function prototype - take a closer look. Anyway, style does matter and were this line written with readability in mind you wouldn't make this mistake. Also, I would definitely abstract over @get and property: makeProperty = (attrs...) ->
func = () -> (@get(x) for x in attrs).join(" ")
func.property(attrs...)
MyApp.president = Ember.Object.create(
fullName: makeProperty("firstName", "lastName")
)
The parens after create are not needed, the next indented line should tell us that this is a function with arguments, but I don't mind them here. |
|