1
코멘트 부분이 포함 된 세부 정보 페이지가 있습니다. 0.8 전에 그들은 단지 상세 객체가 를 업데이트 할 때 코드는 다음과 같은블레이즈 업데이트 후 유성 반응이 작동하지 않습니다.
detail.html이 업데이트 지금, 코멘트를 업그레이드 할 경우 반응과 minimongo의 변화를 반영
{{#with brick}}
{{> brick_item}}
{{> comment_system bind="url" parentType="brick" context=.}}
{{/with}}
comments.html
<template name="_comment_system">
<section class="comments">
{{#each comments}}
[...]
{{/each}}
</section>
</template>
는
Template._comment_system.created = function(){
var bindFilter = _BindSwitcher[Template._comment_system.bind()()]();
Template._comment_system.subscription = Meteor.subscribe("comments", bindFilter);
};
Template._comment_system.destroyed = function(){
Template._comment_system.subscription.stop();
};
Template._comment_system.helpers({
comments : function(){
var queryOptions = _.extend({sort: {createdAt: -1}}, Template._comment_system.reactive());
if(Template._comment_system.subscription.ready())
return Comments.find({}, queryOptions);
}
});
_BindSwitcher = {
'url' : function(){
return window.location.pathname;
},
'data' : function(){
return 'bind1'
}
}
[...]
을 comments.js
수집 및 게시는 일반적인 것과 아무런 차이가 없습니다. 문제는 코멘트가 반응이 없다는 것입니다. mongodb에 주석을 삽입하면 페이지에 표시되지 않습니다. minimongo에 주석을 삽입하면 표시되지 않습니다. 이들은 벽돌이 수정 된 후에 만 나타납니다. 그리고 댓글 시스템을 {{#with brick}} 밖으로 가져 가면 벽돌을 변경 한 후에도 댓글이 업데이트되지 않습니다. 0.8 이전에는 반응성에 문제가 없었습니다.
내가 실종 된 것을 누군가가 지적하고 내가하지 않았던 방식으로 일부 기능을 사용한다면?
미리 감사드립니다.
내가 코드의 일부를 확인하지 않았다 넣어, 지금은 {: 거짓 반응} 반환을 참조하십시오. 이상하게도, 나는 그것이 일하기 전에 확신한다. –