0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Node.jsの学習の備忘録と振り返りの記事です。
何かの参考になれば幸いです。
付け足しや訂正などある場合ご教授いただけると
大変嬉しく思います!!

##EJSとは
HTMLとJavaScriptのコード両方を記述できるNode.jsのパッケージ

インストール
npmからインストールnpm install ejs

JavaScript利用

<% %>または<%= %>でかこう

<% %>:ブラウザに何も表示されない(変数の定義などに使用)
<%= %>:ブラウザに表示される

<%const items = [
{id:1,name:'じゃがいも'},
{id:2,name:'にんじん'},
{id:3,name:'玉ねぎ'},
];%>

<ul>
  <% items.forEach((item) => {%>
     <li>
       <span><% = item.id %></span>
       <span><% = item.name %></span>
     </li>
   <%]);%>
</ul>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?