|
<ejs-dialog #Dialog class="dialogrte" [isModal]='true' [content]='content' [target]='target' [buttons]='dlgButtons'>
<ng-template #dialogTemplate>
<div class="e-dlg-header-content">
<button class="e-dlg-closeicon-btn e-control e-btn e-flat e-icon-btn" type="button" title="Close" (click)="closeNav()">
<span class="e-btn-icon e-icon-dlg-close e-icons"></span>
</button>
<div class="e-dlg-header" id="_title">DIALOG WITH RTE</div>
</div>
<!-- first RTE outside accordion-->
<ejs-richtexteditor id='Default' height='250px' [toolbarSettings]='tools' [(ngModel)]="editorVal">
<ng-template #valueTemplate>
The rich text editor component is WYSIWYG.
</ng-template>
</ejs-richtexteditor>
<ejs-accordion>
<e-accordionitems>
<e-accordionitem header='RichTextEditor'>
<ng-template #content>
<!-- first RTE inside accordion-->
<ejs-richtexteditor id='Default2' height='250px' [toolbarSettings]='tools' [(ngModel)]="editorVal">
<ng-template #valueTemplate>
The rich text editor component is WYSIWYG.
</ng-template>
</ejs-richtexteditor>
</ng-template>
</e-accordionitem>
</e-accordionitems>
</ejs-accordion>
</ng-template>
</ejs-dialog> |
|
[app.component.html]
<div *ngIf = 'loadContent'>
<ejs-dialog #Dialog class="dialogrte" [isModal]='true' [visible] ='show'
[target]='target' [buttons]='dlgButtons' >
<ng-template #content >
<div class="e-dlg-header-content">
<button class="e-dlg-closeicon-btn e-control e-btn e-flat e-icon-btn" type="button" title="Close" (click)="closedialog()">
<span class="e-btn-icon e-icon-dlg-close e-icons"></span>
</button>
<div class="e-dlg-header" id="_title">DIALOG WITH RTE</div>
</div>
<!-- first RTE outside accordion-->
<ejs-richtexteditor id='Default' height='250px' [toolbarSettings]='tools' [(ngModel)]="editorVal">
<ng-template #valueTemplate>
The rich text editor component is WYSIWYG.
</ng-template>
</ejs-richtexteditor>
<ejs-accordion>
<e-accordionitems>
<e-accordionitem header='RichTextEditor'>
<ng-template #content>
<!-- first RTE inside accordion-->
<ejs-richtexteditor id='Default2' height='250px' [toolbarSettings]='tools' [(ngModel)]="editorVal">
<ng-template #valueTemplate>
The rich text editor component is WYSIWYG.
</ng-template>
</ejs-richtexteditor>
</ng-template>
</e-accordionitem>
</e-accordionitems>
</ejs-accordion>
</ng-template>
</ejs-dialog>
</div>
|
|
[app.component.ts]
@ViewChild('Dialog')
public Dialog: DialogComponent;
public loadContent: boolean= false;
public editorVal
public show = false;
public tools: object = {
items: ['Bold', 'Italic', 'Underline', '|',
'Undo', 'Redo', '|',
'FontColor', 'BackgroundColor', '|']
};
public dlgButtons: Object[] = [
{ click: this.closedialog.bind(this), buttonModel: { content: 'CLose', cssClass: 'cancelBtn' } }]
showModal() {
this.loadContent = true;
let localObj: any = this;
setTimeout(function() {
localObj.show = true;
}, 50)
}
closedialog() {
this.Dialog.hide();
this.loadContent = false;
}
|
|
<div *ngIf = 'loadContent'>
<ejs-dialog #Dialog class="dialogrte" [isModal]='true' [visible] ='show' [target]='target' [buttons]='dlgButtons' >
<ng-template #content >
<!-- Your dialog content here -->
</ng-template>
</ejs-dialog>
</div> |
|
[app.component.ts]
public loadContent: boolean= false; // variable set as false to restrict the dialog to render intially
// dialog open action
showModal() {
// While open the dialog, public variable has been set as true to render the dialog
this.loadContent = true;
}
|
|
closedialog() {
// Setting the *ngIf mapping variable as false in dialog close action
this.loadContent = false;
}
|