"posts"의 콘센트를 각 루프의 'posts'에 포함 시키면 어떤 종류의 동작과 유사합니다.ember.js : <a href="http://emberjs.com/guides/" rel="nofollow">ember guide</a>의 <a href="https://github.com/tildeio/bloggr-client" rel="nofollow">bloggr-client</a>에서 시작하는 중첩 된 자원 콘센트의 조건부 배치
는, 예를 들어, 라우터는 다음과 같습니다
이App.Router.map(function() {
this.resource('posts', function() {
this.resource('post', { path: ':post_id' });
});
});
같은 것을해야한다 (가독성을위한 HTML 태그 삭제) 템플릿 :
<script type="text/x-handlebars" id="posts">
{{#each model}}
{{#link-to 'post' this}}{{title}}{{/link-to}}
{{#if :post_id given and corresponding with this post}} <-- that's pseudo code ;-)
{{outlet}}
{{/if}}
{{/each}}
</script>
어떤 생각이 얼마나 제대로이를 위해?
UPDATE 1 :
이 URL에 출력을 명확히하기 위해 '/ 게시물은'해야한다 '/ 글/1'의 URL에
post 1 title
post 2 title
post 3 title
: 홈페이지에
post 1 title
complete post 1
post 2 title
post 3 title
'/posts/2 ':
아마도이 문제는 이미 해결되었지만 문제를 해결하는 데 도움이되는 정말 멋진 [accordion 구성 요소] (http://addepar.github.io/#/ember-widgets/accordion)를 발견했습니다. – GJK