Skip to content

Instantly share code, notes, and snippets.

@yelvert
Created February 11, 2015 02:25
Show Gist options
  • Save yelvert/1c2eb29b1cde45364fff to your computer and use it in GitHub Desktop.
Save yelvert/1c2eb29b1cde45364fff to your computer and use it in GitHub Desktop.
angular style expression locals
<template>
<button click.delegate="clickHandler1($event)"></button>
<button click.delegate="clickHandler2(myVar, $event)"></button>
<typeahead select.delegate="selectItem1($item)"></typeahead>
<typeahead select.delegate="selectItem2(myVar, $item)"></typeahead>
</template>
import {Router} from 'aurelia-router'
export class App {
constructor (router) {
this.myVar = "myVar";
}
clickHandler1(event) {
}
clickHandler2(str, event) {
}
selectItem1(item) {
}
selectItem2(str, item2) {
}
}
import {Behavior} from 'aurelia-framework'
export class Typeahead {
static metadata () {
return Behavior
.customElement('typeahead')
.withProperty('select')
}
constructor () {
}
onSelect(item) {
this.select({$item: item})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment