Skip to content

Commit

Permalink
docs(ejs): include child
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawei397 committed Dec 5, 2023
1 parent c224734 commit 42d876b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/ejs/example/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export class AppController {
hello() {
return {
message: "Hello ejs",
user: {
name: "Tom",
age: 18,
},
};
}
}
1 change: 1 addition & 0 deletions modules/ejs/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
<body>
<h1>Nest</h1>
<p><%= message %></p>
<%- include('user/show', {user}) %>
</body>
</html>
2 changes: 2 additions & 0 deletions modules/ejs/views/user/show.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<p>name: <%= user.name %></p>
<p>age: <%= user.age %></p>

0 comments on commit 42d876b

Please sign in to comment.