我有兩個型號:灰燼數據嵌入屬於關聯關係,則返回null
Question = DS.Model.extend
answers: DS.hasMany("answer")
Answer = DS.Model.extend
question: DS.belongsTo("question")
JSON的服務嵌入到問題中的答案:
"questions": [{
"id":"1.04"
"text":"What is the position or title of the 1% who is being protested against?",
"answers":[
{
"text":"City mayor",
"id":"1.04.02"
},
{
"text":"City council member",
"id":"1.04.03"
},
{
"text":"CEO of some company",
"id":"1.04.01"
}
]
}]
當我打電話question.get('answers')
,灰燼返回的預期陣列答案。但是,如果我撥打answer.get('question')
,我會收到空。任何想法爲什麼發生這種情況?
從2013年年中起,ED的答案不正確。我添加了正確答案 – IgorT 2014-09-22 21:31:13