Skip to content

Commit

Permalink
doc(cheat-sheet): fix some code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Mar 9, 2016
1 parent f3f3934 commit 66db393
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions doc/article/en-US/cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -1539,23 +1539,21 @@ It's worth noting that when binding variables to custom elements, use camelCase

<code-listing heading="Custom Element View-Model Declaration">
<source-code lang="ES 2016">
import {customElement, bindable} from 'aurelia-framework';
import {bindable} from 'aurelia-framework';

@customElement('say-hello')
export class SayHello {
@bindable to;
@bindable greetingCallback
@bindable greetingCallback;

speak(){
this.greetingCallback(`Hello ${this.to}!`);
}
}
</source-code>
<source-code lang="ES 2015">
import {customElement, bindable} from 'aurelia-framework';
import {bindable} from 'aurelia-framework';

export let SayHello = decorators(
customElement('say-hello'),
bindable('to'),
bindable('greetingCallback')
).on(class {
Expand All @@ -1565,12 +1563,11 @@ It's worth noting that when binding variables to custom elements, use camelCase
});
</source-code>
<source-code lang="TypeScript">
import {customElement, bindable} from 'aurelia-framework';
import {bindable} from 'aurelia-framework';

@customElement('say-hello')
export class SayHello {
@bindable to: string;
@bindable greetingCallback: function;
@bindable greetingCallback: Function;

speak(): void {
this.greetingCallback(`Hello ${this.to}!`);
Expand All @@ -1582,10 +1579,10 @@ It's worth noting that when binding variables to custom elements, use camelCase
<code-listing heading="Custom Element Use">
<source-code lang="HTML">
<template>
<require from="say-hello"></require>
<require from="./say-hello"></require>

<input type="text" ref="name">
<say-hello to.bind="name.value" greeting-callback.call="alert($event)"></say-hello>
<say-hello to.bind="name.value" greeting-callback.call="doSomething($event)"></say-hello>
</template>
</source-code>
</code-listing>
Expand Down

0 comments on commit 66db393

Please sign in to comment.