Skip to content

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x.

License

Notifications You must be signed in to change notification settings

iShafayet/legacy-copolymer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copolymer

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x. However, the Polymer project has shifted direction a lot from the original and so, this project is no longer active.

Quick example

import "../polymer/polymer.html"
import "../polymer/paper-checkbox"
import "../polymer/paper-button"
import "../polymer/paper-input"

define todo-app todoList="[]"

  h1 | Todo App
  
  div$todoList vertical layout
    for todo, index in todoList
      div.todoEntry horizontal layout
        paper-checkbox checked="{{todo.isDone}}"
        div | {{todo.text}}
        paper-button %index="{{index}}" *click="deleteClicked" label="Delete"
        
  div horizontal layout
    paper-input label="Type new entry here" value="{{newEntryText}}"
    paper-button *click="addClicked" label="Add"
    
script type="text/coffeescript" `
  Copolymer todo-app, {
    deleteClicked: (e)->
      @todoList.splice (parseInt (e.target.getAttribute 'data-index'), 10), 1
      
    addClicked: (e)->
      @todoList.push {isDone: false, text: @newEntryText}
  }
`

Notes

It was written on the now almost-retired language CoffeeScript. You will need the CoffeeScript compiler to run the code.

About

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published