node-red/packages/node_modules/@node-red/nodes/locales/ko/function/80-template.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/html" 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>