Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TypesInCode/jTemplates

Repository files navigation

j-templates

Type-safe templating for the browser.

Install

npm install --save-dev j-templates

Framework for building reactive browser applications:

  • TypeScript only - no extra transpile or compile steps
  • Bundler agnostic - bundle using your preferred library
  • Low dependencies - hello world only requires this + a bundler to get started

Hello World

import { Component } from 'j-templates';
import { div } from 'j-templates/DOM';

class HelloWorld extends Component {

    public Template() {
        return div({}, () => "Hello world");
    }

}

var helloWorld = Component.ToFunction("hello-world", HelloWorld);
Component.Attach(document.body, helloWorld({}));

Resulting HTML

<hello-world>
    <div>Hello world</div>
</hello-world>

More Examples

About

My attempt to learn typescript by building yet another template engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published