【发布时间】:2012-03-01 14:28:41
【问题描述】:
关于如何将其编写为咖啡脚本的任何想法?
Person = Ember.Object.extend({
// these will be supplied by `create`
firstName: null,
lastName: null,
fullName: function() {
var firstName = this.get('firstName');
var lastName = this.get('lastName');
return firstName + ' ' + lastName;
}.property('firstName', 'lastName')
});
我对代码的}.property 部分特别感兴趣。我不知道怎么用coffeescript写这个。
【问题讨论】:
-
}.property真的应该是},property吗?
标签: coffeescript ember.js