Giter Site home page Giter Site logo

ipoxy's Introduction

ipoxy

Declarative template data binding.

NPM Build Status

Features:

Usage

    ipoxy.bind(target, data)

Syntax

Variables

Can be used inside text:

    <input type="text" value="{{ todo.task }}" />
    Your task: {{ todo.task }}

Repeat

    <ul>
      <template repeat="{{ todos }}">
        <li>{{ task }}</li>
      </template>
    </ul>

If

  <template if="{{ todos.length }}">
    You have {{ todos.length }} todos left.
  </template>

You can also combine if and repeat.

Unless

  <template unless="{{ todos.length }}">
    Well done, you have no todos left!
  </template>

You can also combine unless and repeat.

Inputs

    <input type="checkbox" checked="{{ todo.isDone }}" />

    <select value="{{ isDone }}">
      <option value="true">true</option>
      <option value="false">false</option>
    </select>

    <input type="radio" name="isDone" value="true" checked="{{ isDone }}" /> True
    <input type="radio" name="isDone" value="false" checked="{{ isDone }}" /> False

    <input type="text" value="{{ todo.task }}" />

    <textarea>{{ todo.task }}</textarea>

Filters

{{ expression | filterName }}

html

Do not encode html entities.

class

  <span class="{{ item.selected | class('active') }}"></span>

Create Custom Filter

// getter only
epoxy.registerFilter('uppercase', function(value) {
  return value.length
})

// getter and setter
epoxy.registerFilter('uppercase', {
  get: function(value) {
    return value
  },
  set: function(value) {
    return value.toUpperCase()
  }
})

MIT License

MIT

ipoxy's People

Contributors

rkusa avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.