all imlementations using AngularJS all imlementations of Simple Clicker

a component w/ class implementation
of the Simple Clicker demo using AngularJS

Compare clicker.js to corresponding file in :


import angular from 'angular'

angular.module('clickerapp')
  .component('clicker', {
    template: `
      <p>{{$ctrl.count}} bottles of beer on the wall</p>
      <button ng-click="$ctrl.more()">Buy more</button>
    `,
    controller: class Clicker {
      $onInit () {
        this.count = 3
      }
      more () {
        this.count = this.count + 1
      }
    }
  })