나는 destroyRecord
를 사용하여 내가 할 모델을 삭제하고 심지어 언로드 있다고 확인되면 모델이 그런Ember Data가 저장소에서 캐시를 제거하는 방법은 무엇입니까?
const BlahController = Ember.Controller.extend({
totalRows: Ember.computed('model.[]', function() {
let items = this.get('model') || [];
return items.get('length');
}),
...
})
카운트 표시하는 컨트롤러를 가지고
model.destroyRecord().then(() => {
this.get('store').unloadRecord(model);
}
totalRows
은 결코 왜 어떤 생각 업데이트 된? store.unloadRecord
을 호출하면 실제로 모델을 저장소에서 제거하고 컨트롤러의 모델 배열을 업데이트 할 것입니다.
경로 후크 모델이
const BlahRoute = Ember.Route.extend({
model() {
return this.store.findAll('blah-model');
},
})
경로 모델 후크 방법을 표시 하시겠습니까? findAll 또는 쿼리를 사용하고 있습니까? – kumkanillam
'findAll'을 사용하고 있습니다 – GantengX