Reactivity
Declare state
Ember Octane
<h1>Hello {{this.name}}</h1>
Aurelia 1
<template>
<h1>Hello ${name}</h1>
</template>
Update state
Ember Octane
<h1>Hello {{this.name}}</h1>
Aurelia 1
<template>
<h1>Hello ${name}</h1>
</template>
Computed state
Ember Octane
<div>{{this.doubleCount}}</div>
Aurelia 1
<template>
<div>${doubleCount}</div>
</template>
Templating
Minimal template
Ember Octane
<h1>Hello world</h1>
Aurelia 1
<template>
<h1>Hello world</h1>
</template>
Styling
Ember Octane
/* using: https://github.com/salsify/ember-css-modules */
.title {
color: red;
}
Aurelia 1
.title {
color: red;
}
Loop
Ember Octane
<ul>
{{#each (array "red" "green" "blue") as |color|}}
<li>{{color}}</li>
{{/each}}
</ul>
Aurelia 1
<template>
<ul>
<li repeat.for="color of colors">${color}</li>
</ul>
</template>
Event click
Ember Octane
<p>Counter: {{this.count}}</p>
<button {{on "click" this.incrementCount}}>+1</button>
Aurelia 1
<template>
<p>Counter: ${count}</p>
<button click.trigger="incrementCount()">+1</button>
</template>
Dom ref
Ember Octane
<input {{this.autofocus}} />
Aurelia 1
<template>
<input ref="inputElement" />
</template>
Conditional
Ember Octane
<button {{on "click" this.nextLight}}>Next light</button>
<p>Light is: {{this.light}}</p>
<p>
You must
{{#if (eq this.light "red")}}
STOP
{{else if (eq this.light "orange")}}
SLOW DOWN
{{else if (eq this.light "green")}}
GO
{{/if}}
</p>
Aurelia 1
<template>
<button click.trigger="nextLight()">Next light</button>
<p>Light is: ${light}</p>
<p>
You must
<span if.bind="light === 'red'">STOP</span>
<span if.bind="light === 'orange'">SLOW DOWN</span>
<span if.bind="light === 'green'">GO</span>
</p>
</template>
Lifecycle
On mount
Ember Octane
<p>Page title is: {{(this.pageTitle)}}</p>
Aurelia 1
<template>
<p>Page title is: ${pageTitle}</p>
</template>
On unmount
Ember Octane
<p>Current time: {{this.time}}</p>
Aurelia 1
<template>
<p>Current time: ${time}</p>
</template>
Component composition
Props
Ember Octane
<UserProfile
@name="John"
@age={{20}}
@favouriteColors={{array "green" "blue" "red"}}
@isAvailable={{true}}
/>
Aurelia 1
<template>
<require from="./user-profile"></require>
<user-profile
name.bind="name"
age.bind="age"
favourite-colors.bind="colors"
is-available.bind="available"
></user-profile>
</template>
Emit to parent
Ember Octane
<p>Are you happy?</p>
<AnswerButton @onYes={{this.handleYes}} @onNo={{this.handleNo}} />
<p style="font-size: 50px;">{{if this.isHappy "😀" "😥"}}</p>
Aurelia 1
<template>
<require from="./answer-button"></require>
<p>Can I come ?</p>
<answer-button action-handler.call="handleAnswer(reply)"></answer-button>
<p style="font-size: 50px">${isHappy ? "😀" : "😥"}</p>
</template>
Slot
Ember Octane
<FunnyButton> Click me! </FunnyButton>
Aurelia 1
<template>
<require from="./funny-button"></require>
<funny-button>Click me !</funny-button>
</template>
Slot fallback
Ember Octane
<FunnyButton />
<FunnyButton>I got content!</FunnyButton>
Aurelia 1
<template>
<require from="./funny-button"></require>
<funny-button></funny-button>
<funny-button>Click me !</funny-button>
</template>
Context
Ember Octane
<UserProfile />
Aurelia 1
Missing snippet Help us to improve Component Party 
Form input
Input text
Ember Octane
<p>{{this.text}}</p>
<input value={{this.text}} {{on "input" this.handleInput}} />
Aurelia 1
<template>
<p>${text}</p>
<input value.bind="text" />
</template>
Checkbox
Ember Octane
<input
id="is-available"
type="checkbox"
checked={{this.isAvailable}}
{{on "change" this.handleChange}}
/>
<label for="is-available">Is available</label>
Aurelia 1
<template>
<input id="is-available" type="checkbox" checked.bind="isAvailable" />
<label for="is-available">Is available</label>: ${isAvailable}
</template>
Radio
Ember Octane
<div>Picked: {{this.picked}}</div>
<input
id="blue-pill"
type="radio"
value="blue"
checked={{eq this.picked "blue"}}
{{on "change" this.handleChange}}
/>
<label htmlFor="blue-pill">Blue pill</label>
<input
id="red-pill"
type="radio"
value="red"
checked={{eq this.picked "red"}}
{{on "change" this.handleChange}}
/>
<label htmlFor="red-pill">Red pill</label>
Aurelia 1
<template>
<div>Picked: ${picked}</div>
<input id="blue-pill" checked.bind="picked" type="radio" value="blue" />
<label for="blue-pill">Blue pill</label>
<input id="red-pill" checked.bind="picked" type="radio" value="red" />
<label for="red-pill">Red pill</label>
</template>
Select
Ember Octane
<select {{on "change" this.select}}>
{{#each this.colors as |color|}}
<option
value={{color.id}}
disabled={{color.isDisabled}}
selected={{eq color.id this.selectedColorId}}
>
{{color.text}}
</option>
{{/each}}
</select>
Aurelia 1
<template>
<select value.bind="selectedColorId">
<option value="">Select A Color</option>
<option
repeat.for="color of colors"
value.bind="color.id"
disabled.bind="color.isDisabled"
>
${color.text}
</option>
</select>
</template>
Webapp features
Render app
Ember Octane
Missing snippet Help us to improve Component Party 
Aurelia 1
Missing snippet Help us to improve Component Party 
Fetch data
Ember Octane
{{#let (this.fetchUsers) as |request|}}
{{#if request.isLoading}}
<p>Fetching users...</p>
{{else if request.error}}
<p>An error occurred while fetching users</p>
{{else}}
<ul>
{{#each request.users as |user|}}
<li>
<img src={{user.picture.thumbnail}} alt="user" />
<p>{{user.name.first}} {{user.name.last}}</p>
</li>
{{/each}}
</ul>
{{/if}}
{{/let}}
Aurelia 1
<template>
<p if.bind="isLoading">Fetching users...</p>
<p if.bind="error">An error ocurred while fetching users</p>
<ul if.bind="users">
<li repeat.for="user of users">
<img src.bind="user.picture.thumbnail" alt="user" />
<p>${ user.name.first } ${ user.name.last }</p>
</li>
</ul>
</template>