The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have tried to put an ngIf on the component between ejs-dialog tags, but then the component is rendered outside
e-dlg-content
UDUdhayaKumar Duraisamy Syncfusion Team November 26, 2024 01:38 PM UTC
To optimize page performance and reduce the initial load time, you can dynamically render the dialog content only when needed. Below is an example demonstrating how to achieve this using the*ngIf directive. This ensures that the content is loaded only when the dialog’sshow method is triggered.
In the Succinctly series, Syncfusion created a robust, free library of
more than 130 technical e-books formatted for PDF, Kindle, and EPUB.
<br />
<br />
The Succinctly series was born in 2012 out of a desire to provide
concise technical e-books for software developers Each title in the
Succinctly series is written by a carefully chosen expert and provides
essential content in about 100 pages.
</p>
</div>
</ng-template>
</ejs-dialog>
</div>
[app.component.ts]
export class AppComponent {
@ViewChild('Dialog')
public Dialog: DialogComponent;
public header: string = 'About SYNCFUSION Succinctly Series';
public showCloseIcon: Boolean = true;
public width: string = '50%';
public target: string = '.control-section';
public isContentLoaded: boolean = false;
public BtnClick = (): void => {
this.Dialog.show();
this.isContentLoaded = true;
};
}
Explanation
The*ngIf="isContentLoaded" directive ensures that the dialog content is not rendered until theisContentLoaded property is set totrue.
Clicking the button triggers theBtnClick method, which both displays the dialog and loads the content dynamically.
This deferred loading mechanism improves performance by reducing the initial rendering overhead, particularly for dialogs with heavy or complex content.