JSFiddle - React, Tailwind, and code Playground

by dshilkret

HTML

<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Load AngularJS library -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body ng-controller="myController">

<input type="text" id="myTextbox" placeholder="Type something here..." ng-model="textValue" ng-change="inputChanged()">

<script>
  angular.module('myApp', [])
  .controller('myController', ['$scope', function($scope) {
    $scope.inputChanged = function() {
      var currentValue = $scope.textValue;
      console.log('Current value:', currentValue);
      
      // Detecting text deletion
      if ($scope.oldValue !== undefined && currentValue.length < $scope.oldValue.length) {
        console.log('Text was deleted');
      }
      
      $scope.oldValue = currentValue;
    };
  }]);
</script>

</body>
</html>