This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
function render(model) { | |
return h('div', | |
h('label', "what's your name?"), ' ', | |
h('input', {type: 'text', binding: [model, 'name']}), | |
h('div', 'hi ', model.name) | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div', | |
h('ul', | |
model.people.map(function (person) { | |
return h('li', person.name); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div', | |
h('button', { | |
onclick: function () { | |
return function (render) { | |
setInterval(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render() { | |
return h('div', | |
'width = ' + window.innerWidth + ', height = ' + window.innerHeight, | |
h.window({ onresize: function () {console.log('resizing');} }) | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var blue = { name: 'blue' }; | |
function render(model) { | |
return h('div', | |
h('input.red', { | |
type: 'radio', | |
name: 'colour', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var blue = { name: 'blue' }; | |
function render(model) { | |
return h('div', | |
h('select', | |
{binding: [model, 'colour']}, | |
h('option.red', {value: 'red'}, 'red'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div', | |
h('input', | |
{ | |
type: 'file', | |
binding: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div', | |
model.show | |
? h.component( | |
{ | |
onadd: function (element) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
var component = h.component(function () { | |
return h('div', 'component counter: ', model.counter); | |
}); | |
return h('div', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div.content', | |
h('h1', 'People'), | |
h('ol', | |
model.people.map(function (person) { | |
return renderPerson(model, person); |