UNPKG

can

Version:

MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.

25 lines (20 loc) 528 B
<div id="out"></div> <script src="../../node_modules/steal/steal.js" dev-bundle main="@empty"> import { Component, stache, DefineMap } from "can"; const demoHtml = `<header> <my-greeting> {{ site }} </my-greeting> </header>`; Component.extend({ tag: "my-greeting", view: stache("<h1><content/> - {{ title }}</h1>"), ViewModel: DefineMap.extend({ title: { default: "can-component" } }) }); const template = stache(demoHtml); document.querySelector('#out').appendChild(template({site: "CanJS"})); </script>