Skip to content

Instantly share code, notes, and snippets.

<template>
<div repeat.for="person of persons">
<span with.bind="person" element.ref="el">
${firstName} ${middleName} ${lastName}
</span>
</div>
app.el = ${el} <-- this (global el) should be null
<br/>
person[0].el = ${persons[0].el}
<br/>
@atsu85
atsu85 / app.html
Created July 4, 2016 11:27 — forked from anonymous/app.html
Aurelia view engine hooks
<template>
<p>How to get selected checkbox values to array?</p>
<p>Follwoging <a href="http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/cheat-sheet/5" target="_blank">sample</a> isn't workign:</p>
<label repeat.for="color of colors">
<input type="checkbox" value.bind="color" checked.bind="$parent.favoriteColors" />
${color}
</label>
<p>PROBLEM: expecting array of selected values, not boolean: favoriteColors=${favoriteColors}</p>
</template>
@atsu85
atsu85 / Validator.js
Last active September 7, 2016 09:38 — forked from sylvain-hamel/app.html
binding two values (test)
export class Validator{
constructor(){
this.violatedConstraints = 10;
}
}
@atsu85
atsu85 / app.html
Last active May 10, 2017 00:44 — forked from jdanyow/app.html
Aurelia OnKeyBindingBehavior (`keyup.delegate="eventHandler(message) & onKey:'enter'"`)
<template>
<require from="./on-key"></require>
Press enter in textbox to trigger event:
<input
value.bind="message"
keyup.delegate="textEntered() & onKey:'enter'"
/>
${message}
</template>