JSFiddle - React, Tailwind, and code Playground
by mavdhana
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.6/angular.min.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<div ng-controller="Controller">
<input type="text" id="inputId" ng-model="enteredMessage"
autofocus/>
<i class="fa fa-spinner fa-spin" style="font-size:24px"></i>
<button type="button" ng-click="myFunction(enteredMessage)">
Submit
</button>
Entered: {{myMessage}}
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.controller('Controller',['$scope','$timeout', function ($scope, $timeout) {
$scope.myFunction = function(enteredTextMessage){
$timeout(function() {
//I need to show the spinner for three seconds until my myMessage loading/displaying complete
$scope.myMessage = enteredTextMessage;
}, 3000);
}
}
]);