Skip to content

Instantly share code, notes, and snippets.

View Alexander-Taran's full-sized avatar

Alexander Taran Alexander-Taran

View GitHub Profile
@Alexander-Taran
Alexander-Taran / app.html
Last active April 26, 2018 18:12
Aurelia Gist
<template>
<ul>
<li><a route-href="route: page1; params.bind: {id:1}">page1</a></li>
<li><a route-href="route: page2; params.bind: {id:2}">page2</a></li>
</ul>
<router-view></router-view>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Last active April 25, 2018 14:47
Aurelia Gist
<template>
<h1>${message}</h1>
<div repeat.for="i of 10000">
<button mouseover.delegate="hover($index)" click.delegate="click($index)">click me</button>
</div>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Created April 24, 2018 15:22
Aurelia Gist
<template>
<h1>${message}</h1>
<input value.bind="boo"/>
<div data-something.bind="boo">hey</div>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Last active April 21, 2018 18:08
Aurelia Shared State Class
<template>
<require from='./theme-selector'></require>
<require from='./theme-viewer'></require>
<h1>${message}</h1>
<theme-selector></theme-selector>
<theme-viewer></theme-viewer>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Last active April 10, 2018 18:19
Aurelia Gist
<template>
<require from="boo"></require>
<h1>${message}</h1>
<boo></boo>
<div as-element="boo"></div>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Last active April 8, 2018 20:53 — forked from putstrln/app.html
Template binding for array
<template>
<h1>Referencing other fields in repeat.for of another field</h1>
<p>Even though randoms is updated, times repeat isn't re-rendered since randoms isn't watched in that loop.</p>
<p>To re-render the times loop, we need to use a signal to refresh the UI.</p>
<h2>Times</h2>
<ul>
<li repeat.for='time of times'>
# ${$index} Time - ${time} <-> Random - ${randoms[$index] }
</li>
</ul>
@Alexander-Taran
Alexander-Taran / a.html
Last active March 29, 2018 00:26
Aurelia Gist
<template>
<require from="./c.css"></require>
a.html
</template>
@Alexander-Taran
Alexander-Taran / app.html
Created March 26, 2018 23:41
Aurelia Gist
<template>
<div class="row" repeat.for="option of options">
<div class="col">
<div class="form-group">
<div class="form-check">
<input checked.bind="option.showThis" change.delegate="saveMe(option,$index)" type="checkbox">
<label class="form-check-label">
${option.friendlyName}
</label>
</div>
@Alexander-Taran
Alexander-Taran / app.html
Last active April 10, 2018 18:30
Aurelia Gist
<template>
<h1>${message}</h1>
<a href="#">home</a>
<a href="#/boo">boo</a>
<a href="#/same/123">same with param</a>
<router-view>
</router-view>
</template>
@Alexander-Taran
Alexander-Taran / app.html
Created March 21, 2018 00:01
Aurelia Gist
<template>
<template if.bind="!editing">
<h2>${items.length} items!</h2>
<ul>
<li repeat.for="item of items">
${item.name}
</li>
</ul>
<button click.delegate="toggleEditing()">Edit</button>