Skip to content

Instantly share code, notes, and snippets.

View jsobell's full-sized avatar

Jason Sobell jsobell

View GitHub Profile
@jsobell
jsobell / deepObserver.ts
Last active February 18, 2022 06:30
Deep observer for Aurelia
/**
* Created by Jason on 29/02/2016.
*
* constructor(public deepobserver:DeepObserver) {
* this.obsDisposer = this.deepobserver.observe(this, 'target', (n,o,p)=>
* { console.log('DATA CHANGED:', p, ':', o,'===>', n ); }
* }
* @bindable target:Object;
*
* To remove bindings, call this.obsDisposer();
@jsobell
jsobell / app.html
Last active December 10, 2021 16:05 — forked from jdanyow/app.html
Check all Example
<template>
<h1>${message}</h1>
<a href='#' click.delegate='checkall()'>Check all</a>
<ul>
<li repeat.for='c of checked'><input type='checkbox' checked.bind='c.checked'>Checked ${c.value} : ${c.checked} </li>
</ul>
</template>
@jsobell
jsobell / app.html
Last active November 26, 2020 14:58 — forked from jdanyow/app.html
Aurelia Validation Demo - Nested Property validation
<template>
<form submit.delegate="submit()">
<!--<ul><li repeat.for="error of controller.errors">${error.message}</li></ul>-->
<div class="form-group">
<label class="control-label" for="first">First Name</label>
<input type="text" class="form-control" id="last" placeholder="Last Name"
value.bind="person.firstName & validate">
</div>
@jsobell
jsobell / app.html
Last active October 9, 2020 10:10
Validation without bindings...
<template>
<form submit.delegate="submit()" novalidate autocomplete="off">
<div>
<button type="submit" class="btn btn-primary">Submit</button>
<button class="btn btn-success" click.delegate='reset()'>Reset</button>
<button class="btn btn-info" click.delegate='silent()'>Check...</button>${silentResult}
</div>
<!--<ul><li repeat.for="error of controller.errors">${error.message}</li></ul>-->
<div class="form-group">
@jsobell
jsobell / app.html
Created July 5, 2016 23:38
Aurelia Router Gist
<template>
<ul>
<li repeat.for='r of router.navigation'><a href='${r.href}'>Go to ${r.title}</a></li>
</ul>
<h1>${message}</h1>
<router-view></router-view>
</template>
@jsobell
jsobell / app.html
Last active August 1, 2019 09:56
Aurelia Router Gist with Child router
<template>
<h1>${message}</h1>
Links:
<ul>
<li><a href='#/'>root</a></li>
<li><a href='#connect'>connect</a></li>
<li><a href='#connect/testapp'>connect/testapp</a></li>
</ul>
@jsobell
jsobell / app.html
Created August 1, 2018 22:46
Simple change detector example
<template>
<ul href="#!" repeat.for="user of users">
<li>
<input value.bind='user.firstName' /> <input value.bind='user.lastName' />
</li>
</ul>
</template>
@jsobell
jsobell / app.html
Created July 27, 2018 23:49 — forked from taosd/app.html
Aurelia Gist
<template>
<require from='thingy'></require>
<h1>${message}</h1>
<ul>
<li repeat.for="option of allOptions">
<input type="checkbox" checked.bind="selectedOptions" matcher.bind="matcher" model.bind="option">
${option.text}
</li>
</ul>
@jsobell
jsobell / app.html
Last active July 12, 2018 15:49
Aurelia Validation Demo - Nested Property validation - Experiment
<template>
<form submit.delegate="submit()">
<!--<ul><li repeat.for="error of controller.errors">${error.message}</li></ul>-->
<div class="form-group">
<label class="control-label" for="first">First Name</label>
<input type="text" class="form-control" id="last" placeholder="Last Name"
value.bind="person.firstName & validate">
</div>
@jsobell
jsobell / app.html
Last active March 19, 2018 14:56
Aurelia Validation Demo - controller.validateTrigger=validateTrigger.change issue
<template>
<form submit.delegate="submit()">
<!--<ul><li repeat.for="error of controller.errors">${error.message}</li></ul>-->
<div class="form-group">
<label class="control-label" for="first">First Name</label>
<select value.bind="firstName & updateTrigger:'input' & validate">
<option value='Jason'>Jason</option>
<option value='Fred'>Fred</option>
<option value=''>None</option>