如果我按照文档在咖啡脚本中有一个 ember 对象
Person = Ember.Object.extend
name: null
lastName: null
fullName: Ember.computed ->
return 'hello'
.property('name', 'lastName')
person = Person.create
name: 'Tom'
lastName: 'Tim'
Usingperson.get('fullName')
返回一个 ember 对象而不是全名
m =>
_cacheable: true
_dependentKeys: Array[1]
0: "ownerships"
length: 1
__proto__: Array[0]
func: function () {
__proto__: Ember.Descriptor
因此(我假设),我看到[object Object]
的不是 fullName
<script type="text/x-handlebars" data-template-name="personView">
{{#with App.peopleController.person}}
<dt>First name</dt>
<dd>{{name}}</dd>
<dt>Fullname</dt>
<dd>{{fullName}}</dd>
{{/with}}
</script>
这呈现:
First name
[object Object]