기본 콘텐츠로 건너뛰기

라벨이 rendering인 게시물 표시

Meteor 에서 #constant를 사용하여 collection이 바뀌어도 특정 블록을 유지하기.

meteor는 collection을 기반으로 움직인다. 즉 collection이 변화가 있으면 해당하는 부분의 렌더링을 부분적으로 다시 하는데 고맙게도 preserve-input 이라는 패키지를 기본적으로 사용하여 전체를 다 로딩하지 않게끔 하고 있다. <head>   <title>replyExample</title> </head> <body>   {{> Posts}} </body> <template name="Posts">   <ul>     {{#each posts}}     <li>       {{message}}     </li>     {{/each}}   </ul>   <input type="text" class="newPost"/> </template> 최소한으로 컬렉션을 표시하는 html은 이런 형태일 것이다. @Posts = new Meteor.Collection "posts" if Meteor.isClient   Template.Posts.posts = ->     Posts.find {} .coffee의 내용은 이렇게 되겠지. 하지만 재귀적으로 글>댓글 형식으로 구현할 경우 다소 문제가 된다. <head>   <title>replyExample</title> </head> <body>   {{> Posts}} </body> <template name="Posts">   <ul> ...