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 March 16, 2016 14:43 — forked from opcodewriter/app.html
Aurelia If Bind test on template part
<template>
<section>
<h2>Cascading Selects Example</h2>
<form role="form" submit.delegate="submit()">
<div class="form-group">
<label for="levelOne">Level 1</label>
<select id="levelOne" name="levelOne" value.bind="levelOne">
<option value="">Select a level 1 item</option>
@jsobell
jsobell / app.html
Last active March 17, 2016 11:04
Aurelia If Bind test on template part
<template>
<h2>Simple App</h2>
<h5>Hi ${firstName}</h5>
</template>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<script src="script.js"></script>
@jsobell
jsobell / app.html
Last active April 4, 2016 11:56
Aurelia simple repeat
<template>
<select value.bind="selectedFeature">
<option value=''>All Features</option>
<option repeat.for="feature of features" model.bind="feature">${feature.Name}</option>
</select>
Selected: ${selectedFeature.Name}, ID=${selectedFeature.id}
</template>
@jsobell
jsobell / app.html
Created April 12, 2016 06:05
Aurelia simple repeat
<template>
<a href="#!" click.delegate="selectUser(user.id)" class="collection-item ${user.state}" repeat.for="user of users" id="user-${user.id}">
<span if.bind="!user.lastName">${user}</span>
<span if.bind="user.firstName">${user.lastName}, ${user.firstName}</span>
</a>
</template>
@jsobell
jsobell / app.html
Created April 12, 2016 06:37
Aurelia simple repeat
<template>
<a href="#!" click.delegate="selectUser(user.id)" class="collection-item ${user.state}" repeat.for="user of users" id="user-${user.id}">
<span if.bind="!user.lastName">${user}</span>
<span if.bind="user.firstName">${user.lastName}, ${user.firstName}</span>
</a>
</template>
@jsobell
jsobell / app.html
Created April 12, 2016 06:37
Aurelia simple repeat
<template>
<a href="#!" click.delegate="selectUser(user.id)" class="collection-item ${user.state}" repeat.for="user of users" id="user-${user.id}">
<span if.bind="!user.lastName">${user}</span>
<span if.bind="user.firstName">${user.lastName}, ${user.firstName}</span>
</a>
</template>
@jsobell
jsobell / app.html
Created April 18, 2016 23:25
Aurelia simple repeat
<template>
<a href="#!" click.delegate="selectUser(user.id)" class="collection-item ${user.state}" repeat.for="user of users" id="user-${user.id}">
<span if.bind="!user.lastName">${user}</span>
<span if.bind="user.firstName">${user.lastName}, ${user.firstName}</span>
</a>
</template>
@jsobell
jsobell / app.html
Created April 18, 2016 23:25
Aurelia simple repeat
<template>
<a href="#!" click.delegate="selectUser(user.id)" class="collection-item ${user.state}" repeat.for="user of users" id="user-${user.id}">
<span if.bind="!user.lastName">${user}</span>
<span if.bind="user.firstName">${user.lastName}, ${user.firstName}</span>
</a>
</template>