Skip to content

Instantly share code, notes, and snippets.

View davismj's full-sized avatar
🎓
Computing normal vectors.

Matthew James Davis davismj

🎓
Computing normal vectors.
View GitHub Profile
@davismj
davismj / app.html
Last active March 11, 2020 16:51
dynamic compose vm api
<template>
<!-- static fields -->
<div>vm1</div>
<select value.bind="vm1">
<option>thingA</option>
<option>thingB</option>
</select>
<div>vm2</div>
<select value.bind="vm2">
@davismj
davismj / app.html
Created January 24, 2020 15:31
"Select All" Checkbox
<template>
<compose view-model="test" model.bind="obj"></compose>
</template>
@davismj
davismj / app.html
Created January 7, 2020 22:05
DI inheritance
<template>
<div repeat.for="i of 10">
${i} ${obj[i]}
<button click.delegate="obj[i] = true">do</button>
</div>
</template>
@davismj
davismj / app.html
Last active November 27, 2019 19:10
DI inheritance
<template>
<compose model.bind="{ authId: authId, caseId: caseId }" view-model="test"></compose>
<input change.delegate="authId = $event.target.value" value.one-way="authId" />
<input change.delegate="caseId = $event.target.value" value.one-way="caseId" />
</template>
@davismj
davismj / app.html
Last active November 6, 2019 17:30
"Select All" Checkbox
<template>
<p>
<label>
<input type="checkbox" checked.bind="canSort" change.delegate="if(canSort) sorting = 0" />
Enable Sorting
</label>
</p>
<p>
@davismj
davismj / app.html
Created October 30, 2019 18:28
Compose Deactivation
<template>
<router-view></router-view>
</template>
@davismj
davismj / app.html
Last active October 28, 2019 21:47
Checked and If play nice together
<template>
<div>
<input type="checkbox" checked.bind="one" />1
</div>
<div>
<input type="checkbox" checked.bind="two" />2
</div>
<div>
<input type="checkbox" if.bind="one && two" change.delegate="$el.innerText = 'works good'" />change
</div>
@davismj
davismj / app.html
Created October 17, 2019 17:38
"Select All" Checkbox
<template>
<table>
<thead>
<tr>
<th>
<input type="checkbox"
checked.one-way="selected.length === items.length"
indeterminate.one-way="selected.length > 0 && selected.length < items.length"
change.delegate="$event.target.checked ? selected = items.slice() : selected = []" />
</th>
@davismj
davismj / a.html
Created October 17, 2019 17:06
Compose Deactivation
<template>
<p>a</p>
<a href="#b">b</a>
<compose view-model="comp"></compose>
</template>
@davismj
davismj / app.html
Created October 10, 2019 17:22
Compose Deactivation
<template>
<router-view layout-view="layout.html"></router-view>
<a href="#/one">one</a>
<a href="#/two">two</a>
</template>