JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="helloApp" ng-controller="helloCtrl">
<p>Name:
<input type="text" placeholder="your name" ng-model="myName">
</p>
<div>Hi {{myName}}</div>
<div ng-show="nothingEnteredFlag">You haven't entered anything yet!</div>
<div>{{message}}</div>
JavaScript
var app = angular.module("helloApp", []);
app.controller("helloCtrl", function ($scope) {
$scope.nothingEnteredFlag=false;
$scope.$watch("myName", function (newValue, oldValue) {
if ($scope.myName.length < 5) {
$scope.message = "Short name!";
} else {
$scope.message = "Long name!";
}
});
});