1. Home
  2. /
  3. Aurelia
  4. /
  5. Counter with Double Increment

Counter with Double Increment - Aurelia Typing CST Test

Loading…

Counter with Double Increment — Aurelia Code

A counter that doubles the value on increment.

export class Counter {
	count = 1;
	isDark = false;

	increment() { this.count *= 2; }
	decrement() { this.count = Math.floor(this.count / 2); }
	reset() { this.count = 1; }
	toggleTheme() { this.isDark = !this.isDark; }
}

<div class.bind="isDark ? 'dark-theme' : 'light-theme'">
	<h2>Counter: ${count}</h2>
	<div>
		<button click.delegate="increment()">Double</button>
		<button click.delegate="decrement()">Half</button>
		<button click.delegate="reset()">Reset</button>
	</div>
	<button click.delegate="toggleTheme()">Toggle Theme</button>
</div>

Aurelia Language Guide

Aurelia is a modern, open-source, front-end framework focused on clean architecture, minimal boilerplate, and standards-based development. It emphasizes unobtrusive conventions and powerful data binding.

Primary Use Cases

  • ▸Enterprise-grade SPA development
  • ▸Modular, maintainable business applications
  • ▸Highly data-bound interfaces
  • ▸Standards-based ES module projects
  • ▸Custom framework/tooling integrations

Notable Features

  • ▸Powerful two-way data binding
  • ▸Convention over configuration (but less strict than Ember)
  • ▸Dependency injection container
  • ▸Templating based on standards (no proprietary syntax)
  • ▸Highly modular architecture

Origin & Creator

Created by Rob Eisenberg in 2015 after leaving the Angular team, built around modern ES standards and extensibility.

Industrial Note

Aurelia is specialized for teams seeking clean architecture, minimal framework intrusion, and deep customizability for enterprise apps.

More Aurelia Typing Exercises

Aurelia Simple CounterAurelia Counter with StepAurelia Counter with Max/MinAurelia Counter with HistoryAurelia Counter with Auto IncrementAurelia Counter with Limits and StepAurelia Counter with Even/Odd IndicatorAurelia Counter with Double Click IncrementAurelia Counter with Color Themes

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher