Skip to content
kevinhellosPublic

About

0.6 kb JavaScript templating library

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RazorJS

JavaScript library for Razor (@) templating.

⚠️ Warning: DO NOT USE in production

There is a bug in which all eventListener in the document is cancelled off.

CDN link

<script src="https://cdn.jsdelivr.net/gh/iskevinlemon/RazorJS/Razor.js"></script>

Usage examples

Data Binding (bind value)

<h1>@color</h1> <!-- Razor @variable will be rendered as <h1>blue</h1> -->

<script>
    var color = "blue"; // set the value variable "color"
</script>

Data Binding (bind js)

<button @sayhello>Click me</button>

<script>
    var sayhello = `onclick="alert('Hello')"`;
</script>

Data Binding (bind component)

@goodmorning <!-- will be rendered as <h3>Good Morning</h3> -->

<script>
    var goodmorning = '<h3>Good Morning</h3>';
</script>

About

0.6 kb JavaScript templating library

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages