covalent icon indicating copy to clipboard operation
covalent copied to clipboard

Feature Request: HTML message in Simple Dialogs

Open trevorsmiley opened this issue 7 years ago • 9 comments

Feature Request

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
      }
    });
  }

trevorsmiley avatar Jun 27 '17 19:06 trevorsmiley

We can probably set it as innerHTML and sanitize it instead of as a string to support this.

emoralesb05 avatar Jun 27 '17 20:06 emoralesb05

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!

Octopixell avatar Aug 29 '17 09:08 Octopixell

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

kyleledbetter avatar Aug 29 '17 15:08 kyleledbetter

You're completely right @kyleledbetter ;) I'll look at that instead!

Octopixell avatar Aug 30 '17 11:08 Octopixell

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.

aciccarello avatar Aug 30 '17 15:08 aciccarello

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

trevorsmiley avatar Aug 30 '17 15:08 trevorsmiley

+1 on this. I really just want to embed a link in it.

jmsunseri avatar Aug 30 '18 16:08 jmsunseri

Keeping this open for debate if should add more functionality to "simple dialog"

jeremysmartt avatar Sep 06 '18 18:09 jeremysmartt

+1 on this.

webplease avatar Feb 04 '19 08:02 webplease