Skip to content

Instantly share code, notes, and snippets.

@dfoderberg
dfoderberg / app.html
Created November 29, 2017 22:36 — forked from davismj/app.html
bug
<template>
<h1>Davis' Height</h1>
<p>
For the inches input, we do the following:<br />
<ol>
<li>First, we remove the inches value converter. The canonical value is inches, so we don't need to convert
the value.</li>
<li>Next, we add a number value converter. Seems trivial, but this ensures that our value always comes back
from the view as a number. We could add this to the decimals value converter, except it might not be clear
how that would behave. Would it return a number of max precision, or of precision n?</li>
@dfoderberg
dfoderberg / app.html
Last active November 29, 2017 22:36 — forked from davismj/app.html
bug
<template>
<h1>Davis' Height</h1>
<p>
For the inches input, we do the following:<br />
<ol>
<li>First, we remove the inches value converter. The canonical value is inches, so we don't need to convert
the value.</li>
<li>Next, we add a number value converter. Seems trivial, but this ensures that our value always comes back
from the view as a number. We could add this to the decimals value converter, except it might not be clear
how that would behave. Would it return a number of max precision, or of precision n?</li>
<template>
<!--<h1>Matt's Height</h1>-->
<!--<div><input type="number" value.bind="mattHeight | feet" /></div>-->
<!--<div><input type="number" value.bind="mattHeight | inches" /></div>-->
<!--<div>${mattHeight}</div>-->
<h1>Davis' Height</h1>
<div><input type="number" value.bind="davisHeight | inches" /></div>
<div><input type="number" value.bind="davisHeight | mm" /></div>
<div>${davisHeight}</div>
</template>
@dfoderberg
dfoderberg / app.html
Created November 28, 2017 20:19 — forked from anonymous/app.html
Feet & Inches value converters
<template>
<h1>Matt's Height</h1>
<div><input type="number" value.bind="mattHeight | feet" /></div>
<div><input type="number" value.bind="mattHeight | inches" /></div>
<div>${mattHeight}</div>
<h1>Davis' Height</h1>
<div><input type="number" value.bind="davisHeight | feet" /></div>
<div><input type="number" value.bind="davisHeight | inches" /></div>
<div>${davisHeight}</div>
</template>