Would like to be able to use html strings as the message for the simple dialogs for the TdDialogService. Would allow use of bold () and line breaks (
) and others in the message.
ex
openConfirm(): void {
this._dialogService.openConfirm({
message: '<b>This</b> is how simple it is to create a confirm with this wrapper service.<br>br>Do you agree?',
disableClose: true | false, // defaults to false
viewContainerRef: this._viewContainerRef, //OPTIONAL
title: 'Confirm', //OPTIONAL, hides if not provided
cancelButton: 'Disagree', //OPTIONAL, defaults to 'CANCEL'
acceptButton: 'Agree', //OPTIONAL, defaults to 'ACCEPT'
}).afterClosed().subscribe((accept: boolean) => {
if (accept) {
// DO SOMETHING
} else {
// DO SOMETHING ELSE
}
});
}
We can probably set it as innerHTML and sanitize it instead of as a string to support this.
What's the status on this right now? I was looking for this feature but sad to see it's not available yet. Thanks in advance!
i wonder at what point we need to draw the line for "simple" dialogs, and just use the material dialog API for things like HTML templates https://material.angular.io/components/dialog/overview
You're completely right @kyleledbetter ;) I'll look at that instead!
I think more complex dialogs should be built from the material dialog. The covalent docs should probably include a link to the material service though.
I guess as @kyleledbetter mentions it's to decide how simple is "simple".
ie "_This_ is too complex" to be used in a simple dialog
+1 on this. I really just want to embed a link in it.
Keeping this open for debate if should add more functionality to "simple dialog"
+1 on this.
Most helpful comment
i wonder at what point we need to draw the line for "simple" dialogs, and just use the material dialog API for things like HTML templates https://material.angular.io/components/dialog/overview