Skip to content

Instantly share code, notes, and snippets.

@dfoderberg
Created November 28, 2017 20:31
Show Gist options
  • Save dfoderberg/23e03335b3227c8942e875bf55b938a8 to your computer and use it in GitHub Desktop.
Save dfoderberg/23e03335b3227c8942e875bf55b938a8 to your computer and use it in GitHub Desktop.
bug
<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>
export class App {
// mattHeight = 67;
davisHeight = 75;
}
// how do i round inches without having it break the input.
export class InchesValueConverter {
total = 0;
toView(inches) {
this.total = inches;
return Number(this.total).toFixed(3);
}
fromView(inches) {
return (inches);
}
}
export class MmValueConverter {
total = 0;
toView(inches) {
return (inches * 25.4).toFixed(0);
}
fromView(mm) {
console.log(mm);
return (mm / 25.4);
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app>
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment