Initialize the Spinner using createSpinner
method and show/hide the spinner using showSpinner
and hideSpinner
methods accordingly. Set the target to the spinner to render it based on specific target.
The following steps explains you on how to create and how to show/hide your Spinner.
createSpinner
method from ej2-popups
library into your file as shown in below.import { createSpinner } from '@syncfusion/ej2-popups';
showSpinner
and hideSpinner
methods for loading in your page and import them in your file as shown in below.import { showSpinner, hideSpinner } from '@syncfusion/ej2-popups';
The Spinner can be render globally in a page using public exported functions of the ej2-popups
package.
import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';
//createSpinner() method is used to create spinner
createSpinner({
// Specify the target for the spinner to show
target: document.getElementById('container')
});
// showSpinner() will make the spinner visible
showSpinner(document.getElementById('container'));
setInterval(function(){
// hideSpinner() method used hide spinner
hideSpinner(document.getElementById('container'));
}, 100000);
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Spinner</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="TypeScript NumericTextBox Component" />
<meta name="author" content="Syncfusion" />
<link href="//cdn.syncfusion.com/ej2/20.3.47/ej2-base/styles/material.css" rel="stylesheet" />
<link href="//cdn.syncfusion.com/ej2/20.3.47/ej2-popups/styles/material.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='container'>
</div>
</body>
</html>