Skip to content

Instantly share code, notes, and snippets.

@michaelnero
Created May 22, 2021 08:53
Show Gist options
  • Save michaelnero/c1f20770b87217102fb53541c43d8060 to your computer and use it in GitHub Desktop.
Save michaelnero/c1f20770b87217102fb53541c43d8060 to your computer and use it in GitHub Desktop.
Aurelia interpolation/to-view behavior
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber Gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to "main" (data-main attribute on script)
which is your src/main.ts.
-->
<body>
<my-app></my-app>
<script src="/dist/entry-bundle.js" data-main="main"></script>
</body>
</html>
{
"dependencies": {
"aurelia": "latest"
}
}
import Aurelia from 'aurelia';
import { MyApp } from './my-app';
Aurelia.app(MyApp).start();
<p>
<input type="text" min.to-view="min">
<input type="text" min="${min}">
</p>
<p>
<a href.to-view="min">Link</a>
<a href="${min}">Link</a>
</p>
export class MyApp {
public min: string = undefined;
public linkHref: string = undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment