JavaScript 框架:ConstraintJS

jopen 10年前

ConstraintJS 是一个用来开发动态 Web 应用的 JavaScript 框架。
cjs_logo_256.png

<label>Title:</label>  <input class='form-control' type='text' cjs-out='demonym'          placeholder='Demonym' value='Commander' />     <label>Members (comma-separated):</label>  <input class='form-control' type='text' cjs-out='items'          placeholder='Comma-separated items'          value='Kirk, Spock, Sulu, Uhura' />     <hr /> <label>Result:</label>     <ul class="list-group">        {{#each items.split(",")}}          <li class="list-group-item">              <strong>{{demonym}} {{@index}}</strong>: {{this}}          </li>      {{/each}}  </ul>     // works with jQuery ($)  cjs.createTemplate($("#ex2code"), {}, $("#ex2"));

更干净的代码

ConstraintJS enables constraints — relationships that are declared once & automatically maintained. These constraints can make writing dynamic apps easier.

轻量级

ConstraintJS is small (about 10kb) and works well with other JavaScript libraries like jQuery.

简单的语法

ConstraintJS's API is very learnable and includes features for dynamic handlebars-like templates.


 

项目主页:http://www.open-open.com/lib/view/home/1409132209697