Skip to content
Snippets Groups Projects
Commit 4fc1add6 authored by Marcel Mernitz's avatar Marcel Mernitz
Browse files

Update application.hbs

parent 284dc41a
No related branches found
No related tags found
No related merge requests found
<h1>Calculator</h1>
<form {{on "submit" this.calculate}}>
<label>
A
<Input @value={{this.a}} name="a" type="number" />
</label>
<label>
B
<Input @value={{this.b}} name="b" type="number" />
</label>
<select onchange={{action "setNewOperator" value="target.value"}}>
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
<option value="%">%</option>
</select>
<button>Calculate</button>
</form>
{{#if calculated}}
<h2>Result</h2>
<div id="result">
<p>{{this.a}} {{this.operator}} {{this.b}} = {{this.result}}</p>
</div>
{{/if}}
{{#if historyAvailable}}
<h2>History</h2>
<div id="history">
<ul>
{{#each this.calculationsList as | calculation |}}
<li><a {{on "click" (fn this.recalculate calculation.calc)}}>{{calculation.calc}}</a></li>
{{/each}}
</ul>
</div>
{{/if}}
{{outlet}}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment