我有一個包含用於處理結帳過程的一些邏輯灰燼成分checkout-form
。下面是我如何使用它的簡化版本:灰燼「動作傳遞爲空或在(動作)未定義」錯誤
{{#checkout-form}}
{{#each model.courses.otherDates as |date|}}
{{course-date model=date selectDate=(action selectDate) }}
{{/each}}
{{/checkout-form}}
裏面我checkout-form.js
分量的,我有以下作用:
selectDate(day) {
this.set("startAt", day.get("serverString"))
}
我
course-date.js
構件的內部
最後我:
click() {
const courseStart = this.get('courseStart')
this.get('selectDate')(courseStart)
}
但是,運行此代碼時出現錯誤:
ember.debug.js:19818 Assertion Failed: Action passed is null or undefined in (action) from <[email protected]:checkout/date::ember389>.
我在這裏錯過了什麼?我將這個行爲傳遞給course-date
組件,不知道爲什麼它要求一個控制器?
'{{yield(action'selectDate')}}'完美地完成了這個技巧。謝謝! – gosseti