JSFiddle - React, Tailwind, and code Playground

by Sam Stites

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="clicktest">
  <div ng-controller="MyController as ctrl">
    <p>
      {{::ctrl.title}}
    </p>
    <a href="#" ng-click="$evalAsync(ctrl.singleClickAction())" ng-dblclick="ctrl.doubleClickAction()">
       Click for "foo" double-click for "bar"
      </a>
    <p>
      {{ctrl.text}}
    </p>

  </div>
</body>

CSS

.done-true {
  text-decoration: line-through;
  color: grey;
}

TypeScript

angular.module('clicktest', [])
  .controller('MyController', function() {
    var ctrl = this;

    ctrl.title = "here's an example in Angular " + angular.version.full + ":"
    ctrl.text = "___"

    this.singleClickAction = () => {
      ctrl.text = "foo"
    }
    this.doubleClickAction = () => {
      ctrl.text = "bar"
    };
  });