Consider you have a simple, standard $http request to a REST api:...function makeCall() {    var restURL = http://my-rest-api/endpoint;    return $http.get(restURL);}...If the execution time of this call varies for whatever reason (sometimes returns immediately, other times takes around a second to e), what is the best practice for normalizing the response time to the user?In the past, I've done things like this:...function makeCall() {    var restURL = http://my-rest-api/endpoint;    return $http.get(restURL);}...function myController($scope) {    var promise = makeCall(); //make rest call    $scope.waitMessage = true;    $timeout(function() {        //before resolving the promise, wait a certain number of ms, then        //resolve and display data to user        promise.then(function(response) {            $scope.output = response.data;            $scope.waitMessage = false;        });    }, 1000);}This is an attempt to make the request take a fixed amount of time, regardless of if it returned immediately or not. During the delay time, I display an interstitial of some kind saying Loading, please wait... or the like, controlled by a variable like $scope.waitMessage. Any best practices for this sort of use case?
Using $timeout to normalize response time of a webservice call (Best practice question)
angularjs;asynchronous programming