mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!--
 | |
|   Copyright JS Foundation and other contributors, http://js.foundation
 | |
| 
 | |
|   Licensed under the Apache License, Version 2.0 (the "License");
 | |
|   you may not use this file except in compliance with the License.
 | |
|   You may obtain a copy of the License at
 | |
| 
 | |
|   http://www.apache.org/licenses/LICENSE-2.0
 | |
| 
 | |
|   Unless required by applicable law or agreed to in writing, software
 | |
|   distributed under the License is distributed on an "AS IS" BASIS,
 | |
|   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | |
|   See the License for the specific language governing permissions and
 | |
|   limitations under the License.
 | |
| -->
 | |
| 
 | |
| <script type="text/x-red" data-help-name="template">
 | |
|     <p>템플릿에 기초하여 프로퍼티를 설정합니다.</p>
 | |
|     <h3>입력</h3>
 | |
|     <dl class="message-properties">
 | |
|         <dt>msg <span class="property-type">오브젝트</span></dt>
 | |
|         <dd>템플릿을 생성하기 위한 정보를 포함한 메세지 오브젝트</dd>
 | |
|         <dt class="optional">template <span class="property-type">문자열</span></dt>
 | |
|         <dd><code>msg.payload</code>를 생성하기 위한 템플릿. 편집패널에서 템플릿을 설정하지 않은 경우에는, 출력메세지로 이용합니다.</dd>
 | |
|     </dl>
 | |
|     <h3>출력</h3>
 | |
|     <dl class="message-properties">
 | |
|         <dt>msg <span class="property-type">오브젝트</span></dt>
 | |
|         <dd>지정한 템플릿과 입력메세지의 프로퍼티로 생성된 값을 설정한 메세지</dd>
 | |
|     </dl>
 | |
|     <h3>상세</h3>
 | |
|     <p>이 노드는 <i><a href="http://mustache.github.io/mustache.5.html" target="_blank">mustache</a></i>형식을 기본값으로 이용하지만, 사용하지 않도록 설정할 수도 있습니다.</p>
 | |
|     <p>예를 들면,
 | |
|     <pre>안녕하세요, {{payload.name}}씨. 오늘은 {{date}}입니다.</pre>
 | |
|     <p>라는 템플릿에 대해,
 | |
|     <pre>{
 | |
|   date: "월요일",
 | |
|   payload: {
 | |
|     name: "홍길동"
 | |
|   }
 | |
| }</pre>
 | |
|     <p>이라는 메세지를 수신한 경우,</p>
 | |
|     <pre>안녕하세요, 홍길동씨. 오늘은 월요일입니다.</pre>
 | |
|     <p>라는 프로퍼티가 생성됩니다.</p>
 | |
|     <p>플로우 컨텍스트 혹은 글로벌 컨텍스트의 프로퍼티값을 사용할 수도 있습니다. 각각, <code>{{flow.이름}}</code>혹은 <code>{{global.이름}}</code>을 사용합니다. 또는, 퍼시스터블스토어(<code>store</code>)에 대해서는, <code>{{flow[store].이름}}</code>혹은 
 | |
|     <code>{{global[store].이름}}</code>을 사용합니다.
 | |
| </p>
 | |
|     <p><b>주: </b>기본값으로는, <i>mustache</i>형식은 치환대상인 HTML요소를 이스케이프합니다. 이것을 방지하기 위해서는 <code>{{{3중}}}</code>괄호형식을 사용해야 합니다.</p>
 | |
| </script>
 |