"Handlebars"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
잔글
잔글
10번째 줄: 10번째 줄:
  
  
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
 
=== This page contains the following errors: ===
 
<div style="font-family:monospace;font-size:12px">error on line 8 at column 71: attributes construct error </div>
 
=== Below is a rendering of the page up to the first error. ===
 
</parsererror>
 
 
== 사용법 ==
 
== 사용법 ==
 
<pre><script id="domain_list_content" type="text/x-handlebars-template">
 
<pre><script id="domain_list_content" type="text/x-handlebars-template">
23번째 줄: 18번째 줄:
 
&nbsp;  List&nbsp;: {{@index}}, {{this}}
 
&nbsp;  List&nbsp;: {{@index}}, {{this}}
 
     @first, @last {{#unless @last}}~{{/unless}}&nbsp;   
 
     @first, @last {{#unless @last}}~{{/unless}}&nbsp;   
 +
{{/each}}
 +
 +
{{#each array as |value key|}}
 +
    {{#each child as |childValue childKey|}}
 +
        {{key}} - {{childKey}}. {{childValue}}
 +
    {{/each}}
 
{{/each}}
 
{{/each}}
  
 
</pre>
 
</pre>
 
 
== 참고 문헌 ==
 
== 참고 문헌 ==
  
 
*[http://programmingsummaries.tistory.com/381 http://programmingsummaries.tistory.com/381]
 
*[http://programmingsummaries.tistory.com/381 http://programmingsummaries.tistory.com/381]

2016년 11월 11일 (금) 16:05 판

handlebars JavaScript Library를 정리 한다.



사용법

<script id="domain_list_content" type="text/x-handlebars-template">
{{#if debug}}<th>Links</th>{{else}} ~ {{/if}}

{{#each domains}}
    Map : {{@key}}, {{this}}
    List : {{@index}}, {{this}}
    @first, @last {{#unless @last}}~{{/unless}}    
{{/each}}

{{#each array as |value key|}}
    {{#each child as |childValue childKey|}}
        {{key}} - {{childKey}}. {{childValue}}
    {{/each}}
{{/each}}

참고 문헌