Angular LoadPanel - Show on Page Load
To display a LoadPanel on page load, initialize the component with visible set to true. You can hide the LoadPanel once your page or data finishes loading. The following code snippet demonstrates how to hide the component after ODataStore finishes loading data:
app.component.html
app.component.ts
- <dx-load-panel
- shadingColor="rgba(0,0,0,0.4)"
- [visible]="loadingVisible"
- ></dx-load-panel>
- import { DxLoadPanelModule } from 'devextreme-angular';
- import ODataStore from "devextreme/data/odata/store";
- export class AppComponent {
- loadingVisible: boolean = true;
- data: ODataStore = new ODataStore({
- url: "https://js.devexpress.com/Demos/DevAV/odata/Products"
- });
- constructor() {
- this.data.load().then(() => {
- this.loadingVisible = false;
- });
- }
- }