0
[email protected]
[email protected]
我傳遞一個簡單的模型到一個組件,但得到以下對象(我看起來像實際的燼數據模型是在value屬性下)。爲什麼模型指向這個而不是實際的模型?傳遞組件和獲得奇怪的結果
路線
export default Ember.Route.extend({
model() {
return this.store.createRecord('employee');
}
})
模板
{{log model}} {{!-- logging here correctly displays the ember-data object --}}
{{my-component model=model}}
我也試過這樣:
<my-component model={{model}} /> <!-- which prints the folowing in HTML <model-editor model="<[email protected]:employee::ember395:null>"></model-editor>-->
成分(我組分)
export default Ember.Component.extend({
layout,
didReceiveAttrs() {
console.log(this.attrs.model); //Prints the Object above
}
});