TypeScript-authored Angular templates (compiled at build time)
Write Angular templates as TypeScript modules executed during the webpack build. The output is a template string that can include Angular bindings/directives (runtime), while TypeScript helps you compose and share markup (build time).
// hello.tshtml
import { html } from 'tshtml';
export default html`
<h1>Hello {{ userName }}</h1>
<p *ngIf="isAdmin">Admin mode</p>
`;
This TypeScript module runs during the webpack build and produces an Angular template string.
npm install tshtml tshtml-loader
📖 Complete Documentation & Guides on GitHub
MIT