Skip to content

Instantly share code, notes, and snippets.

@geleto
geleto / app.html
Last active September 17, 2016 13:26
Different behaviour with number and string getter
<template>
<select value.two-way="optionId">
<option repeat.for="choice of options" value.bind="$index">${choice}</option>)
</select>
<label>Number</label>
<br><br>
<select value.two-way="optionId2">
@geleto
geleto / app.html
Last active May 1, 2017 08:52 — forked from jdanyow/app.html
Aurelia Gist
<template>
<div repeat.for="i of messages.length">
<input type="text" value.bind="$parent.messages[i]" input.delegate="onMessageChanged()">
</div>
</template>
@geleto
geleto / app.html
Last active September 26, 2016 19:54
Aurelia Gist
<template>
<require from="./test"></require>
<test></test>
</template>
@geleto
geleto / app.html
Last active October 2, 2016 22:56
Select bound to a sub-property does not update properly when changing the parent property
<template>
<label>Car</label>
<select value.bind="selectedCar">
<option repeat.for="car of cars" model.bind="car">${car.name}</option>)
</select>
<br>
Selected car: <b>${selectedCar.name}</b>
<br>
<br>
@geleto
geleto / app.html
Last active November 25, 2016 08:50
Select bound to a sub-property does not update properly when changing the parent property
<template>
<label>Car</label>
<select value.bind="selectedCar">
<option repeat.for="car of cars" model.bind="car">${car.name}</option>)
</select>
<br>
Selected car: <b>${selectedCar.name}</b>
<br>
<button click.delegate="selectCar(0)">Select Audi</button>
@geleto
geleto / app.css
Last active October 3, 2016 19:25
aurelia-dragula test
.group{
display:block;
width:300px;
border: 2px dashed blue;
padding:10px;
}
.item{
width:260px;
margin:10px;
border: 2px dashed blue;
@geleto
geleto / app.html
Last active October 27, 2016 12:09
Aurelia - change to a bound repeat input element is applied to the VM a second time after the element has been deleted.
<template>
<div repeat.for="i of messages.length">
<input type="text" value.bind="$parent.messages[i]" input.delegate="onMessageChanged()">
</div>
</template>
@geleto
geleto / app.html
Last active October 27, 2016 15:43
Aurelia - change to a bound repeat input element is applied to the VM a second time after the element has been deleted.
<template>
<h3>Change any value except the first</h3>
<div repeat.for="i of messages.length">
<input type="text" value.bind="$parent.messages[i]" input.delegate="onMessageChanged()">
</div>
<h4>Notice how the change is also applied to an unrelated sibling element</h4>
</template>
@geleto
geleto / app.html
Last active October 27, 2016 13:24 — forked from martonsagi/app.html
Aurelia: Deleting array elements when changed to empty value - no 2-way binding
<template>
<div repeat.for="msg of messages">
<input type="text" value.bind="msg" input.delegate="onMessageChanged(msg, $index)">
</div>
</template>
@geleto
geleto / app.html
Created October 27, 2016 13:22
Aurelia: Deleting array elements when changed to empty value - WORKING!
<template>
<div repeat.for="msg of messages">
<input type="text" value.bind="msg" input.delegate="onMessageChanged(msg, $index)">
</div>
</template>