Skip to content

Commit

Permalink
chore: add for & if examples for asp syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Hosein Salimi committed Dec 18, 2022
1 parent f10a4d8 commit 20655f3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/asp/for.ts
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);
13 changes: 13 additions & 0 deletions examples/asp/if.ts
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);

0 comments on commit 20655f3

Please sign in to comment.