Created
February 11, 2015 02:25
-
-
Save yelvert/1c2eb29b1cde45364fff to your computer and use it in GitHub Desktop.
angular style expression locals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Router} from 'aurelia-router' | |
export class App { | |
constructor (router) { | |
this.myVar = "myVar"; | |
} | |
clickHandler1(event) { | |
} | |
clickHandler2(str, event) { | |
} | |
selectItem1(item) { | |
} | |
selectItem2(str, item2) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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