Skip to content

Instantly share code, notes, and snippets.

@lstarky
lstarky / app.html
Last active March 2, 2017 19:04
Aurelia select list binding
<template>
<require from="./my-dropdown"></require>
<div class="container-fluid">
<h1>Hello, ${fname}!</h1>
Number: ${num}
<my-dropdown value.bind="num" enum-list.bind="enums"></my-dropdown>
<br>
Change value:
<button click.delegate="setNum(1)">1</button>
<button click.delegate="setNum(2)">2</button>
@lstarky
lstarky / app.html
Last active January 12, 2022 14:45 — forked from jdanyow/app.html
Aurelia Validation on dynamic form
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@lstarky
lstarky / app.html
Last active March 18, 2018 15:50
Aurelia modify sidebar from router view (with eventAggregator)
<template>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="#/home">Home</a></li>
<li><a href="#/square">Square</a></li>
<li><a href="#/circle">Circle</a></li>
</ul>
</div>
</nav>
@lstarky
lstarky / app.html
Last active February 16, 2017 02:29
Aurelia modify sidebar from router view (with compose)
<template>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="#/home">Home</a></li>
<li><a href="#/square">Square</a></li>
<li><a href="#/circle">Circle</a></li>
</ul>
</div>
</nav>
@lstarky
lstarky / app.html
Last active February 16, 2017 02:19
Aurelia modify sidebar from router view
<template>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="#/home">Home</a></li>
<li><a href="#/square">Square</a></li>
<li><a href="#/circle">Circle</a></li>
</ul>
</div>
</nav>
@lstarky
lstarky / app.html
Last active February 20, 2017 13:33
Aurelia Router ViewPorts Demo
<template>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!--<div class="collapse navbar-collapse">-->
<ul class="nav navbar-nav">
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}">
<a href.bind="row.href">${row.title}</a>
</li>
</ul>
<!--</div>-->
@lstarky
lstarky / app.html
Last active February 12, 2017 23:23
Displaying the Json result in Table with some logic
<template>
<div class="container-fluid">
<h1>Table Method</h1>
<table width="100%">
<td>
<div repeat.for="field of myData" if.bind="field.order % 2">
<p><b>${field.Key}:</b> ${field.value}</p>
</div>
</td>
<td>
@lstarky
lstarky / app.html
Last active February 11, 2017 15:43 — forked from jdanyow/app.html
Aurelia Validation addObject and removeObject Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@lstarky
lstarky / app.html
Last active January 18, 2017 01:51
Change event in Aurelia
<template>
<div class="container">
<h1>Hello, ${fname}!</h1>
<form>
<div class="form-group">
<label class="control-label">Name input (no change event on input):</label>
<input type="text" class="form-control" value.bind="fname">
</div>
<div class="form-group">
<label class="control-label">Name input (change and keyup events on input):</label>
@lstarky
lstarky / app.html
Last active December 30, 2016 13:15
Liam's Radio Boxes
<template>
<h1>Hello, ${fname}!</h1>
<hr>
<label repeat.for="option of options">
<input type="radio" name="opta" model.bind="option" checked.bind="$parent.selectedOption">
${option.value}<br>
</label>
Selected: <strong>${selectedOption.id} (${selectedOption.value})</strong>
</template>