GithubHelp home page GithubHelp logo

plenyun / nyanrepeat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nyancodeid/nyanrepeat

0.0 1.0 0.0 42 KB

DOM Repeat like ng-repeat, work with jQuery

License: MIT License

HTML 18.86% JavaScript 81.14%

nyanrepeat's Introduction

nyanRepeat

DOM Repeat like ng-repeat, work with jQuery

CDN

Rawgit

<script src="https://cdn.rawgit.com/nyancodeid/nyanRepeat/5ed27cb1/dist/nyanrepeat.min.js" ></script>
<script src="https://cdn.rawgit.com/nyancodeid/nyanRepeat/5ed27cb1/js/nyanrepeat.js" ></script>

GitCDN

<script src="https://gitcdn.xyz/repo/nyancodeid/nyanRepeat/master/dist/nyanrepeat.min.js" ></script>
<script src="https://gitcdn.xyz/repo/nyancodeid/nyanRepeat/master/js/nyanrepeat.js" ></script>

Example

HTML

<div data-repeat="posts">
  <h2 data-repeat-item="title"></h2>
  <span data-repeat-item="subtitle"></span>
  <a data-repeat-attr="link in href" data-repeat-item="download"></a>
</div>

Javascript

var posts = [
  {
    title: 'Foo Bar 1',
    subtitle: 'foo bar subtitle',
    link: 'foo.html',
    download: 'boom.zip'
  },
  {
    title: 'Foo Bar 2',
    subtitle: 'foo bar subtitle',
    link: 'bar.html',
    download: 'anotherBoom.zip'
  }
];
nyan.repeat.init(); /* Call nyanRepeat */

Description

Attribut Value Syntax Example
data-repeat variabel array yang akan di Repeat "arrayname" data-repeat="posts"
data-repeat-item array key yang akan di tampilkan element "arraykey" data-repeat-item="title"
data-repeat-attr array key yang akan di tampilkan di attribut "arraykey in attributname" or "arraykey in attributkey,anotherArrayKey in anotherAttributName" data-repeat-attr="link in href"

Demo

Kamu bisa memcoba demo dari nyanRepeat disini Atau kamu bisa langsung coba di jsFiddle disini

License

This software is provided free of charge and without restriction under the MIT License

Authors

Ryan Aunur Rassyid

Build with Love in Jombang, East Java, Indonesia

nyanrepeat's People

Contributors

nyancodeid avatar

Watchers

 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.