Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Last active September 7, 2016 16:57
Show Gist options
  • Save mbroadst/7cea3c3fc566f58e89cb5106c87c868a to your computer and use it in GitHub Desktop.
Save mbroadst/7cea3c3fc566f58e89cb5106c87c868a to your computer and use it in GitHub Desktop.
view-model.ref bug
<template>
<require from="my-element"></require>
<my-element view-model.ref="testField"></my-element>
</template>
export class App {
constructor(controllerFactory) {
}
activate() {
this.timerid = setInterval(() => {
this.testField.value = Math.floor(Math.random() * 1000);
}, 1000);
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body aurelia-app="main" class="container">
<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>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot());
}
<template>
<input type="text" value.bind="value">
</template>
export class MyElement {
constructor() { this.value = "test"; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment