-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add
for
& if
examples for asp
syntax
- Loading branch information
Amir Hosein Salimi
committed
Dec 18, 2022
1 parent
f10a4d8
commit 20655f3
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { TemplateEngine } from '../../src'; | ||
|
||
const template = `<% for (let i = 0; i < 10; i += 1) {%> | ||
This is the index: <% i %> | ||
<% } %>`; | ||
|
||
const templateEngine = new TemplateEngine('asp'); | ||
|
||
const result = templateEngine.compile(template, {}); | ||
|
||
console.log(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { TemplateEngine } from '../../src'; | ||
|
||
const template = `<% if (true) {%> | ||
<% "This should be displayed" %> | ||
<% } else { %> | ||
<% "This should not be displayed" %> | ||
<% } %>`; | ||
|
||
const templateEngine = new TemplateEngine('asp'); | ||
|
||
const result = templateEngine.compile(template, {}); | ||
|
||
console.log(result); |