JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<div ng-controller="HelloController">
<input ng-model="greeting.text">
<p>
{{greeting.text}}, World
</p>
</div>
</div>
JavaScript
function HelloController ($scope) {
$scope.greeting = {
text: "Hello"
};
$scope.$watch("greeting.text", function (newValue, oldValue) {
if (newValue == "") {
alert($scope.greeting.text);
}
});
}