add a Loading window to widget while the server is updating

Marina15
Tera Expert

Hello everyone!
I have in the widget there is a confirmation of the action through the swal in the client controller

 

swal({
~~~~
}).then(result => {
if (result.value) {
c.server.update();
} 

 

I want it to show a loading window while the server is processing information and updating, and when it finishes, it closes. How can I implement this?

2 REPLIES 2

Sebastian L
Mega Sage

Maybe something like this.. 

In the HTML you could have something like: 

<div align="center" ng-show="!dataLoaded && loading">
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
<span class="sr-only">${Loading}...</span>
</div>
<div ng-show="dataLoaded" >  
<p>content</p>
</div>

 

And in the client you could add two variables:

//Client
     $scope.dataLoaded = false;
    $scope.loading = false;

// And then set loading to true when you are loading, so inside your swal maybe??
$scope.loading = true; 

//And in your if(result.value)  - have something like this..
$scope.loading = false;
$scope.dataLoaded = true;
}

 

 


Best regards,
Sebastian Laursen

I need it to be an overlay, or a popup window that closes itself