JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="Imei">
<div ng-controller="homeController">
<button ng-click="showAlert()"> Show alert </button>
<div ng-show="alertMsg.show">{{alertMsg.text}}</div>
</div>
</div>
JavaScript
var imei = angular.module("Imei", []);
imei.controller('homeController', function ($scope, $timeout) {
$scope.alertMsg = {
show: false,
text:"Alert message is ::show"
};
$scope.showAlert =function(){
$scope.alertMsg.show = true;
$timeout(function(){
$scope.alertMsg.show = false;
}, 2000);
}
});