README
kick
kick.js is a variation of Rivets.js and tinybind, a lightweight data binding and templating system that facilitates building data-driven views. Inspired by many libraries like angular, react, angular-lite and vuejs. It is agnostic about every aspect of a front-end MV(C|VM|P) stack, making it easy to introduce it into your current workflow or to use it as part of your own custom front-end stack comprised of other libraries.
If you like short syntax, and symbols for binding html then you will love it.
See kick in action with the short syntax at https://stackblitz.com/edit/kick-js1
Simple drag drop https://jsfiddle.net/riteshpahwa/ecn1fq6j/
Not so simple drag drop http://jsfiddle.net/riteshpahwa/qym37hbf/119/
ToDo MVC with KickJS, pay attention to the simple syntax https://stackblitz.com/edit/js-r5mnzv
You can also run examples (in examples folder) by installing npm i http-server
CAUTION:
Not ready for prod. Need help with few more things, like expression binding, testing, etc.
Install
npm install @radkick/kick
Use in a script tag...
<script src="node_modules/@radkick/kick/dist/kick.min.js"></script>
... or import using a bundler like webpack
import kick from '@radkick/kick'
Usage
<section id="auction">
<h3>{{ auction.product.name }}</h3>
<p>Current bid: {{ auction.currentBid | money }}</p>
<aside ?="auction.timeLeft | lt 120">
Hurry up! There is {{ auction.timeLeft | time }} left.
</aside>
</section>
var auction = {currenBid: 250, timeLeft: 100, product: {name: 'iPhone'} };
kick.bind($('#auction'), {auction: auction})
Quick Reference for bindings ^ or ^click (<a ^="userClicked()">Link) ^^ or ^dblclick (<a ^^="userDblClicked()">Link) ^_ or ^contextmenu (<a ^="userRightClicked()">Link) ^otherevent (<a ^mouseover="($event)">Link) ^@ or ^change (<input ^="userChanged()" type="text" @="model.property">) ^+ or ^focus (<input ^+="userFocused()" type="text" @="model.property">) ^- or ^blur (<input ^-="userBlurred()" type="text" @="model.property">) @ or @value (<input type="text" @="model.property">) @x or @checked (<input type="checkbox" @x="model.isChecked">) @-x or @unchecked (<input type="checkbox" @-x="model.isUnchecked">) : or :text (
) :: or :html () $ or :html (<div $="model.htmlProperty">- or :show (<div +="model.isVisible">